-
Notifications
You must be signed in to change notification settings - Fork 668
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
fix: pass user-defined http(s) agent to websocket methods #953
Conversation
Codecov Report
@@ Coverage Diff @@
## master #953 +/- ##
===========================================
- Coverage 78.57% 64.28% -14.29%
===========================================
Files 2 2
Lines 14 14
Branches 3 3
===========================================
- Hits 11 9 -2
- Misses 3 4 +1
- Partials 0 1 +1
Continue to review full report at Codecov.
|
efc4954
to
2617f4c
Compare
const socket = (this.socket = new w3cWebSocket( | ||
url, | ||
null, | ||
null, | ||
options.headers, | ||
null, | ||
requestOptions, |
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.
I guess the change here is based on https://github.com/theturtle32/WebSocket-Node/blob/master/docs/WebSocketClient.md#connect-using-a-proxy-server
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.
Yep, that's correct!
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.
I have used the axios agent option but never the websocket one. This looks good.
2617f4c
to
cbb0cef
Compare
cbb0cef
to
2840d71
Compare
## [4.5.1](v4.5.0...v4.5.1) (2019-09-19) ### Bug Fixes * pass user-defined http(s) agent to websocket methods ([#953](#953)) ([4f1679c](4f1679c))
🎉 This PR is included in version 4.5.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
We accept
axios
options in the constructor to give the user extended control over their requests but we didn't translate this control over to the WebSocket requests. This PR doesn't give complete control over the WebSocket configuration but it allows the use of custom "agents" which will allow users to use WebSockets behind corporate proxies (an established use case).