http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Proxy websockets

Open pft opened this issue 1 year ago • 2 comments

Proxy websockets when --websocket is given.

Relevant issues

Fixes issue https://github.com/http-party/http-server/issues/142

I took the PR from @fabioimpe at https://github.com/http-party/http-server/pull/528, removed style changes (and made sure not to add any of my own), and removed the changes to the changeOrigin parameter.

And of course, I tested whether it worked, which it does.

pft avatar Oct 15 '24 09:10 pft

Is there any way to test this? This should have tests before I merge it, if a unit test for this is complex I'll do a manual test later.

KernelDeimos avatar Oct 17 '24 18:10 KernelDeimos

Well, it relies on another server working with websockets. A unit test could be done, but would require quite a bit of work.

pft avatar Oct 17 '24 19:10 pft

This pull request has been inactive for 360 days

github-actions[bot] avatar Oct 13 '25 12:10 github-actions[bot]

#872 (another websocket impl) was merged. The changes from this PR are present in #933, with a modification so it adds the --websocket flag to the existing implementation.

KernelDeimos avatar Oct 17 '25 20:10 KernelDeimos

Merged #933. You should still get contribution credit on GitHub because I kept your commits in my modified branch and did a rebase-and-merge to preserve them. Also, please take a look at the unit test from that PR - you mentioned that testing the websockets server requires additional effort but I was able to put something together based on examples from other unit tests. Let me know if you see a way we can make this easier or if something should be documented better.

KernelDeimos avatar Nov 04 '25 01:11 KernelDeimos

Thank you!

pft avatar Nov 04 '25 06:11 pft