8000 Allow specifying options to Faye constructor · sockjs/sockjs-node@dfd84b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit dfd84b8

Browse files
committed
Allow specifying options to Faye constructor
For example, extensions like permessage-deflate. Fixes #170.
1 parent 35ae810 commit dfd84b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/sockjs.coffee

Lines changed: 1 addition & 0 deletions
Origin 8000 al file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class Server extends events.EventEmitter
133133
prefix: ''
134134
response_limit: 128*1024
135135
websocket: true
136+
faye_server_options: null
136137
jsessionid: false
137138
heartbeat_delay: 25000
138139
disconnect_delay: 5000

src/trans-websocket.coffee

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ exports.app =
2020

2121
sockjs_websocket: (req, connection, head) ->
2222
@_websocket_check(req, connection, head)
23-
ws = new FayeWebsocket(req, connection, head)
23+
ws = new FayeWebsocket(req, connection, head, null,
24+
@options.faye_server_options)
2425
ws.onopen = =>
2526
# websockets possess no session_id
2627
transport.registerNoSession(req, @,
@@ -35,7 +36,8 @@ exports.app =
3536
status: 400
3637
message: 'Only supported WebSocket protocol is RFC 6455.'
3738
}
38-
ws = new FayeWebsocket(req, connection, head)
39+
ws = new FayeWebsocket(req, connection, head, null,
40+
@options.faye_server_options)
3941
ws.onopen = =>
4042
new RawWebsocketSessionReceiver(req, connection, @, ws)
4143
return true

0 commit comments

Comments
 (0)
0