-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept hostname lookup family
option when creating WebSockets
#962
Conversation
|
||
it('should accept the family option', function (done) { | ||
const wss = new WebSocketServer({ host: '::1', port: ++port }, () => { | ||
const ws = new WebSocket(`ws://localhost:${port}`, {family: 6}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add spaces inside the options object? { family: 6 }
.
it('should accept the family option', function (done) { | ||
const wss = new WebSocketServer({ host: '::1', port: ++port }, () => { | ||
const ws = new WebSocket(`ws://localhost:${port}`, {family: 6}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a blank line after this?
Done! I think there's an eslint rule for the spaces-in-objects, btw :) |
@hansonw yeah :) we are using semistandard and it doesn't enforce that. |
Thanks! |
http.request
accepts afamily
option to specify the IP address family to use when resolving the server hostname. Seems pretty reasonable to accept this from the WebSocket side and forward it over to thehttp
request call.Specifically, this is useful for Facebook since we have IPv6 only development servers with IPv4 proxies (in which case we need websockets to connect to the IPv6 address)