Use secure websocket if api is https
This commit is contained in:
parent
13f758a18b
commit
aca472e40a
|
@ -15,7 +15,8 @@ const httpLink = new HttpLink({
|
|||
console.log('GRAPHQL ENDPOINT', process.env.GRAPHQL_ENDPOINT)
|
||||
|
||||
let websocketUri = new URL(process.env.GRAPHQL_ENDPOINT)
|
||||
websocketUri.protocol = 'ws'
|
||||
websocketUri.protocol =
|
||||
process.env.GRAPHQL_ENDPOINT.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
|
||||
const wsLink = new WebSocketLink({
|
||||
uri: websocketUri,
|
||||
|
|
Loading…
Reference in New Issue