mirror of
https://github.com/fosrl/newt.git
synced 2026-05-06 07:59:04 -05:00
[PR #334] [MERGED] enhance(http): Support websocket upgrades #2286
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/334
Author: @LaurenceJJones
Created: 4/29/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @oschwartz10612
Base:
dev← Head:private-http-websocket📝 Commits (2)
8e19e47Support websocket upgrades in private HTTP proxyb33c3b8Add some test scripts for ws and move to testing/📊 Changes
6 files changed (+227 additions, -1 deletions)
View changed files
📝
netstack2/http_handler.go(+21 -1)➕
netstack2/http_handler_test.go(+97 -0)📝
testing/udp_client.py(+0 -0)📝
testing/udp_server.py(+0 -0)➕
testing/ws_client.py(+60 -0)➕
testing/ws_server.py(+49 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Preserve optional ResponseWriter interfaces through statusCapture so httputil.ReverseProxy can hijack upgraded websocket connections for private http proxy. Add a regression test covering websocket traffic through the HTTP handler path.
How to test?
Added a golang test for regression but any private http application that uses websockets should now upgrade via the proxy.
Without exposing the funcs
with now succeeds
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.