feat: support forward and reverse HTTP/HTTPS proxy with basic authentication - #49
Merged
Merged
Conversation
…ication - Add HTTP and REVERSE_HTTP client types in proxy.proto and regenerate pb - Implement NewHttpInputer supporting CONNECT tunneling and plain HTTP requests - Support optional Basic proxy authentication with 407 response code - Strip Proxy-Authorization and Proxy-Connection headers to prevent credential leakage - Wire forward HTTP and reverse HTTP proxy into client.go and server.go - Support http_client and reverse_http_client in CLI and config generator - Add comprehensive unit and end-to-end tests for HTTP and reverse HTTP proxy - Update README.md and USAGE.md documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements full support for forward and reverse HTTP/HTTPS proxies in SPP, complete with optional username/password Basic authentication.
Key Features & Implementation
CONNECTmethod for HTTPS and arbitrary TCP streams.HTTP/1.1 200 Connection Establishedupon handshake.GET,POST,PUT,DELETE, etc.).Proxy-AuthorizationandProxy-Connectionheaders before sending to target servers to prevent credential leakage.-usernameand-passwordare configured, proxy requests require validProxy-Authorization: Basic <base64>credentials.HTTP/1.1 407 Proxy Authentication Required.-type http_client): client listens locally onfromaddrand proxies out via the remote server.-type reverse_http_client): server listens onfromaddrand proxies requests into the client network.-genconfignow generatesconfig_http_client.jsonandconfig_reverse_http_client.json.README.mdandUSAGE.mdwith quick start commands and schemas.Testing
proxy/http_test.go:TestHttp_AuthCheck: unit verification for Basic authentication logic.TestE2E_HTTPProxy_Forward: verifies 407 challenge, CONNECT tunneling, and HTTP GET request forwarding.TestE2E_HTTPProxy_Reverse: verifies reverse HTTP proxying and auth handling.TestE2E_HTTPProxy_NoAuth: verifies unauthenticated forward proxying.go test ./...).