devlocker / tychus

Command line utility to live-reload your application.
MIT License
122 stars 3 forks source link

WebSocket support? #7

Open courajs opened 5 years ago

courajs commented 5 years ago

This seems like it would probably be a pretty big feature to add, but have you thought through web socket support? I'm kinda fuzzy on how I would even want it to work, but I might be willing to build it if there was a clear path forward

PatKoperwas commented 5 years ago

I've thought about it, been waiting for someone to raise an issue before I gave it any more time. Are you looking to proxy the websocket connection itself, or is there some other use case?

courajs commented 5 years ago

Yeah, I have a server with both http test endpoints and a web socket live layer, and was trying to use tychus for it. I’ve instead been using tychus for the http endpoints but making the websocket connection directly to the underlying server. Honestly, the only real downside is that I need to put two hosts into config instead of one

PatKoperwas commented 5 years ago

Should be possible, would need to use Hijacker (https://golang.org/pkg/net/http/#Hijacker) when the request is sending upgrade headers

PatKoperwas commented 5 years ago

I might take a stab at this sometime this week or next.