Fix WebSocket proxy URL construction and missing configuration parameter #160
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.
Background
I noticed issue #147 regarding the incorrect WebSocket proxy URL construction. I also saw a similar solution proposed
in PR #149 by @GEverding, which correctly identified the root cause of the problem.
However, PR #149 received a change request from @0xTim asking for tests to verify the proxy URI generation. Since that
PR has not been updated, I have created this PR with the complete fix including the requested test modifications.
Changes
1. Fix proxy URL construction order - Fixes #147
ws://host/path:porttows://host:port/pathtestProxyto expect the correct URL format2. Add missing configuration parameter
configurationparameter when connecting through proxy3. Use correct URI form for wss + proxy connections
wsswith proxy: use origin-form (/path) after CONNECT tunnel per RFC 7230wswith proxy: continue using absolute-form (ws://host:port/path)Tests
testProxyandtestProxyTLSverify the fixes work correctlyNote
testBadHosttest is skipped in test runs as it hangs indefinitely when attempting to connect to an invalid hostname.This is a pre-existing issue in the test suite, unrelated to these fixes.