File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,15 @@ const headers = ripple => next => res => {
137137}
138138
139139const io = opts => {
140+ const transports = client
141+ && document . currentScript
142+ && document . currentScript . getAttribute ( 'transports' )
143+ && document . currentScript . getAttribute ( 'transports' ) . split ( ',' )
144+ || undefined
145+
140146 const r = ! client ? require ( 'socket.io' ) ( opts . server || opts )
141- : window . io ? window . io ( { transports : [ 'websocket' , 'polling' ] } )
142- : is . fn ( require ( 'socket.io-client' ) ) ? require ( 'socket.io-client' ) ( { transports : [ 'websocket' , 'polling' ] } )
147+ : window . io ? window . io ( { transports } )
148+ : is . fn ( require ( 'socket.io-client' ) ) ? require ( 'socket.io-client' ) ( { transports } )
143149 : { on : noop , emit : noop }
144150 r . use = r . use || noop
145151 return r
You can’t perform that action at this time.
0 commit comments