UNPKG
kubo-rpc-client
Version:
latest (6.1.0)
6.1.0
6.0.2
6.0.1
6.0.0
5.4.1
5.4.0
5.3.0
5.2.0
5.1.0
5.0.2
5.0.1
5.0.0
4.1.3
4.1.2
4.1.1
4.1.0
4.0.1
4.0.0
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.0.3
2.0.2
2.0.1
2.0.0
1.0.3
1.0.2
1.0.1
1.0.0
0.0.1
A client library for the Kubo RPC API
github.com/ipfs/js-kubo-rpc-client
ipfs/js-kubo-rpc-client
kubo-rpc-client
/
src
/
lib
/
agent.ts
11 lines
(8 loc)
•
231 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
http
from
'node:http'
import
https
from
'node:https'
export
default
(url?:
URL
):
any
=>
{
if
(url ==
null
) {
throw
new
Error
(
'URL required'
) }
return
url.
protocol
.
startsWith
(
'https'
) ? https.
Agent
: http.
Agent
}