You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an application using websocket.server.copas, i need to access some information from the socket: IP address and port. They can be obtained using luasocket's getpeername (). This method is hidden by copas (but can be worked around using sock.socket).
A very simple hack is to add a field containing the socket inside the ws object passed to the handler, as in this commit: d6c32fb. But you may also want a more general solution available also in websocket.server.ev and in clients.
Maybe i just missed an already existing solution?
The text was updated successfully, but these errors were encountered:
In an application using
websocket.server.copas
, i need to access some information from the socket: IP address and port. They can be obtained using luasocket'sgetpeername ()
. This method is hidden bycopas
(but can be worked around usingsock.socket
).A very simple hack is to add a field containing the socket inside the
ws
object passed to the handler, as in this commit: d6c32fb. But you may also want a more general solution available also inwebsocket.server.ev
and in clients.Maybe i just missed an already existing solution?
The text was updated successfully, but these errors were encountered: