UNPKG
ipfs-api
Version:
latest (26.1.2)
26.1.2
26.1.0
26.0.3
25.0.0
24.0.2
24.0.1
24.0.0
23.0.0
22.3.0
22.2.4
22.2.3
22.2.2
22.2.1
22.2.0
22.1.1
22.1.0
22.0.2
22.0.1
22.0.0
21.0.0
20.2.1
20.2.0
20.0.1
20.0.0
19.0.0
18.2.1
18.2.0
18.1.2
18.1.1
18.0.0
17.5.0
17.3.0
17.2.7
17.2.6
17.2.5
17.2.4
17.2.3
17.2.0
17.1.3
17.1.2
17.1.1
17.1.0
17.0.1
17.0.0
16.0.0
15.1.0
15.0.2
15.0.1
15.0.0
14.3.7
14.3.5
14.3.4
14.3.3
14.3.2
14.3.1
14.2.1
14.2.0
14.1.2
14.1.1
14.1.0
14.0.4
14.0.3
14.0.2
14.0.1
14.0.0
13.0.0
12.1.7
12.1.6
12.1.5
12.1.4
12.1.3
12.1.2
12.1.0
12.0.3
12.0.2
12.0.1
12.0.0
11.2.0
11.1.0
11.0.1
11.0.0
10.0.0
9.0.0
8.0.4
8.0.3
8.0.2
8.0.1
8.0.0
7.0.0
6.0.3
6.0.2
6.0.1
5.0.1
5.0.0
4.1.1
4.1.0
4.0.3
4.0.2
4.0.1
4.0.0
3.0.3
3.0.2
3.0.1
3.0.0
2.13.2
2.13.1
2.13.0
2.12.0
2.11.0
2.10.2
2.10.1
2.10.0
2.9.15
2.9.14
2.9.13
2.9.12
2.9.11
2.9.10
2.9.8
2.9.7
2.9.3
2.9.2
2.9.1
2.9.0
2.8.1
2.8.0
2.7.6
2.7.5
2.7.4
2.7.3
2.7.1
2.7.0
2.6.2
2.6.1
2.6.0
2.5.1
2.5.0
2.4.1
2.4.0
2.3.3
2.3.2
2.3.1
2.3.0
2.2.1
2.2.0
2.1.6
2.1.5
2.1.4
2.1.3
2.1.2
2.1.1
2.1.0
2.0.2
2.0.1
2.0.0
1.2.0
1.1.8
1.1.7
1.1.6
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.2
1.0.1
1.0.1-2
1.0.1-1
1.0.0
0.0.7
0.0.6
0.0.4
0.0.3
0.0.3-2
0.0.3-1
0.0.2
0.0.1-2
A client library for the IPFS HTTP API
github.com/ipfs/js-ipfs-api
ipfs/js-ipfs-api
ipfs-api
/
src
/
utils
/
request.js
13 lines
(9 loc)
•
231 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
const
httpRequest =
require
(
'http'
).
request
const
httpsRequest =
require
(
'https'
).
request
module
.
exports
=
(
protocol
) =>
{
if
(protocol.
indexOf
(
'https'
) ===
0
) {
return
httpsRequest }
return
httpRequest }