feathersjs-ecosystem / socketio

[MOVED] The Feathers Socket.io websocket transport plugin
https://github.com/feathersjs/feathers
MIT License
37 stars 14 forks source link

Options are not passed to socket-io #101

Closed jamesholcomb closed 6 years ago

jamesholcomb commented 6 years ago

According to the docs, options can be passed to engine-io

app.configure(socketio(options [, callback]))

Sets up the Socket.io transport with the given Socket.io options object and optionally calls the callback described above.

Steps to reproduce

const socketio = require("feathers-socketio")
const feathers = require("feathers")
const app = feathers()
app.configure(socketio({ pingTimeout: 500 }, (io) => { })

Expected behavior

Options should be passed to engine-io

Actual behavior

Options are not passed (pingTimeout is still default 60000)

engine handshaking client "Pc2Haio7MvD9rkT5AAAA" +0ms
engine:socket sending packet "open" ({"sid":"Pc2Haio7MvD9rkT5AAAA","upgrades":[],"pingInterval":25000,"pingTimeout":60000}) +2ms
engine:socket flushing buffer to transport +0ms
engine:ws writing "0{"sid":"Pc2Haio7MvD9rkT5AAAA","upgrades":[],"pingInterval":25000,"pingTimeout":60000}" +0ms

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): feathers-socketio 2.0.1

NodeJS version: 8.9 Operating System: MacOS Browser Version:

React Native Version: 0.46.4 Module Loader:

daffl commented 6 years ago

Setting options is being tested in https://github.com/feathersjs/socketio/blob/158e067aff7e5597d281c4bc1f5231d2b1bffb29/test/index.test.js#L91, I'm not sure where the issue might be at the moment.

jamesholcomb commented 6 years ago

False alarm...was due to a bad import which set pingInterval to undefined.