feat(caddy): add a WebSockets handler that connects to Shadowsocks handler#216
Merged
Conversation
23e1d37 to
2f96565
Compare
2f96565 to
21b32cb
Compare
fortuna
reviewed
Sep 24, 2024
46407e4 to
c4a74d7
Compare
fortuna
requested changes
Oct 7, 2024
c4f554e to
1a18692
Compare
fortuna
reviewed
Jan 28, 2025
sbruens
commented
Feb 8, 2025
fortuna
reviewed
Feb 11, 2025
fortuna
approved these changes
Feb 19, 2025
| } | ||
| } | ||
| } | ||
| cx := layer4.WrapConnection(conn, []byte{}, h.zlogger) |
There was a problem hiding this comment.
WrapConnection seems to potentially add significant overhead with the rewind logic. It will be helpful to understand the impact later, and we can consider moving away from the layer4 module.
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.
This PR enables Shadowsocks-over-WebSockets functionality in the Caddy server, allowing clients to connect to Shadowsocks servers via WebSockets. This is achieved by introducing three new modules:
Named Connection Handlers: These reusable handlers can be shared by different applications and are configured within the Outline app.
WebSocket-to-Outline Handler: An HTTP app handler which bridges WebSocket requests to a designated named connection handler, enabling Shadowsocks connections over WebSockets.
Layer4 Outline Handler: A layer 4 handler which bridges TCP/UDP connections to a designated named connection handler.
Example Configuration:
This example demonstrates how to configure a Shadowsocks handler with access keys and utilize it for both WebSocket and TCP connections: