Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

HTTP headers #50

Closed
atoy40 opened this issue Nov 22, 2016 · 2 comments
Closed

HTTP headers #50

atoy40 opened this issue Nov 22, 2016 · 2 comments

Comments

@atoy40
Copy link

atoy40 commented Nov 22, 2016

It can be useful to be able to set headers in the client (W3CWebSocket class allows it via constructor fourth parameter), for example to include authentication informations

Anthony.

@Urigo
Copy link
Contributor

Urigo commented Dec 2, 2016

see discussion here - apollographql/graphql-subscriptions#27

@Urigo
Copy link
Contributor

Urigo commented Feb 5, 2017

@atoy40 , the implementation of W3CWebSocket is for NodeJS environment only, and when using the native WebSocket of the browser, you can't add your own custom HTTP headers (it's browser's policy, that's why you can still do it when using NodeJS).
However, we recently merged this PR: #53 , which allows you to create a custom INIT message with custom data, so you can use it as headers object.
Let me know if that answers your needs

@Urigo Urigo closed this as completed Feb 5, 2017
baconz pushed a commit to PhiloInc/subscriptions-transport-ws that referenced this issue Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants