FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
javascript-client/src/platform/getOptions/node.js at dev_mode · splitio/javascript-client · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
splitio
/
javascript-client
Public
Notifications
You must be signed in to change notification settings
Fork
38
Star
49
Code
Issues
2
Pull requests
5
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
javascript-client
/
src
/
platform
/
getOptions
/
node.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (18 loc) · 626 Bytes
Breadcrumbs
javascript-client
/
src
/
platform
/
getOptions
/
node.js
Copy path
File metadata and controls
23 lines (18 loc) · 626 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//
@TODO
// 1- handle multiple protocols automatically
// 2- destroy it once the sdk is destroyed
import
https
from
'https'
;
import
{
find
}
from
'@splitsoftware/splitio-commons/src/utils/lang'
;
const
agent
=
new
https
.
Agent
(
{
keepAlive
:
true
,
keepAliveMsecs
:
1500
}
)
;
export
function
getOptions
(
settings
)
{
// User provided options take precedence
if
(
settings
.
sync
.
requestOptions
)
return
settings
.
sync
.
requestOptions
;
// If some URL is not HTTPS, we don't use the agent, to let the SDK connect to HTTP endpoints
if
(
find
(
settings
.
urls
,
url
=>
!
url
.
startsWith
(
'https:'
)
)
)
return
;
return
{
agent
}
;
}
Back
|
FazBrowse Home
|
New Git URL