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

ResponseWriter Interface to support Hijack() to allow websocket #15

Closed
JeffMerlet opened this issue Nov 30, 2017 · 4 comments
Closed

ResponseWriter Interface to support Hijack() to allow websocket #15

JeffMerlet opened this issue Nov 30, 2017 · 4 comments

Comments

@JeffMerlet
Copy link

In order to support websocket with violetear, using something like Gorilla websocket, violetear's ResponseWriter implementation would need to support the Hijack() function. The Gin project added that feature for the same reason; see gin-gonic/gin@4a24c47

Thanks!

@nbari
Copy link
Owner

nbari commented Nov 30, 2017

Hi, @JeffMerlet to support all interfaces don't use LogRequests by default is disabled, or set it to false:

 router := violetear.New()
 router.LogRequests = false

Please give a try and let me know if works.

@JeffMerlet
Copy link
Author

I can confirm that when setting router.LogRequests to false I'm able to connect to the websocket without any problem; and was even able to retrieve a named param used on the web socket URL without any problem.

@JeffMerlet
Copy link
Author

I will close the issue now. But I would suggest to add some documentation and/or simple example about it as it could be helpful for others. Thanks and great job on the router!

@nbari
Copy link
Owner

nbari commented Dec 4, 2017

@JeffMerlet just in case https://violetear.org/post/websocket-hijack/ is not much but hope helps please feel free to modify/chance as convenient.

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

2 participants