Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make client socket accessible? #83

Open
saucisson opened this issue Sep 23, 2015 · 0 comments
Open

Make client socket accessible? #83

saucisson opened this issue Sep 23, 2015 · 0 comments

Comments

@saucisson
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant