kataras / go-websocket

:speaker: Deprecated. Use https://github.com/kataras/neffos instead
MIT License
60 stars 16 forks source link

expose req *http.Request to connection #2

Closed notedit closed 8 years ago

notedit commented 8 years ago

so we can do some auth use cookie and query param

ghost commented 8 years ago

Websocket are not the same as HTTP, you can do header-authentication only, otherwise just make a REST endpoint and take the user from there, pass these information to a websocket message from client to server

notedit commented 8 years ago

yes but i need get the http request header in the connection.

i have used socketio, socketio can handle this.

ghost commented 8 years ago

Make a PR as you said, I will approve it if it's correct, don't be afraid, go on, I will be happy!

notedit commented 8 years ago

ok

notedit commented 8 years ago

have a pr here https://github.com/kataras/go-websocket/pull/3

notedit commented 8 years ago

i have another idea, maybe we could use a Middleware

ghost commented 7 years ago

req := c.Request() .

An Iris(v6) example: https://github.com/iris-contrib/examples/blob/master/websocket/main.go#L34