Skip to content

Commit d368bbe

Browse files
author
pemrouz
committed
feat: prefer ws over polling
1 parent 697f560 commit d368bbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ const headers = ripple => next => res => {
138138

139139
const io = opts => {
140140
const r = !client ? require('socket.io')(opts.server || opts)
141-
: window.io ? window.io()
142-
: is.fn(require('socket.io-client')) ? require('socket.io-client')()
141+
: window.io ? window.io({ transports: ['websocket', 'polling'] })
142+
: is.fn(require('socket.io-client')) ? require('socket.io-client')({ transports: ['websocket', 'polling'] })
143143
: { on: noop, emit: noop }
144144
r.use = r.use || noop
145145
return r

0 commit comments

Comments
 (0)