Closed Robby- closed 8 years ago
Oh, it didn't auto-close.
For anyone else having issues retrieving headers or cookies using event_data.connection.state.client.websocket.transport.req.headers
or event_data.connection.state.client.websocket.transport.req.headers.cookie
in their server modules, the better way as of 4a680edaa9aab3c18c13c5e4e03f3bb2cbabec29 is event_data.connection.state.client.websocket.meta.headers
for the headers and event_data.connection.state.client.websocket.meta.headers.cookie
for the cookie.
I'm using a client plugin and a server module called
username
. It generates a string of random alphanumeric characters which is then stored in a cookie and used as the ident of the user on IRC.It turns out that the server module sometimes fails to retrieve the headers, and thus the cookie.
However, it seems that manually setting
conf.client_transports
to eitherpolling
orwebsocket
in config.js seems to fix the issue, rather than leaving that option commented out, which causes cookie retrieval to fail at random. This "fix" is however not ideal as it will lock browsers to the configured transport.I added the following to
server_modules/username.js
to see what happens:When it is failing
obj2
returns onlyundefined
, andobj1
returns the following: