-
Notifications
You must be signed in to change notification settings - Fork 48
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
enable socketio clients to communicate with client using only the protocols set in the config #39
Conversation
21dfaef
to
c24f069
Compare
7b55f44
to
f07c318
Compare
f07c318
to
1177bb3
Compare
1177bb3
to
754abde
Compare
754abde
to
94126a9
Compare
All the changes are here. Will do the any other requested changes after my training tomorrow. |
@@ -26,10 +26,14 @@ const DEFAULT_THROTTLE_MILLISECS = 4000; | |||
const realtimeEventThrottleMilliseconds = | |||
pe.realtimeEventThrottleMilliseconds || DEFAULT_THROTTLE_MILLISECS; | |||
|
|||
const socketIOtransportProtocol = pe.SOCKETIO_TRANSPORT_PROTOCOL || 'undefined'; |
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.
Why using string 'undefined' here? It seems like it has potential for misunderstanding given javascript's "undefined" reserved word. I would rather see something like this:
const socketIOtransportProtocol = pe.SOCKETIO_TRANSPORT_PROTOCOL || null;
or
const socketIOtransportProtocol = pe.SOCKETIO_TRANSPORT_PROTOCOL || '';
... and then in app.js line 105, just check for if (clientProtocol) {
const options = {}; | ||
const clientProtocol = transProtocol; | ||
if (clientProtocol !== 'undefined') { | ||
options.transports = clientProtocol.replace(/\s*,\s*/g, ',').split(','); |
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 add a comment about this regex and the format the socket.io options.transports requires?
…et only communication
pr updated |
?protocol=websocket is the query param to force the client to communicate over websocket. |
@pallavi2209 @iamigo web concurrency also seems to be working. Can you check if it set the config var right ? I set WEB_CONCURRENCY = 2. |
@shriramshankar Thats great! The config var looks right to me. |
No description provided.