-
Notifications
You must be signed in to change notification settings - Fork 871
WebSocket Support (SS over WSS) and OutlineCaddy Integration #1685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ersion number extraction.
…apply formatting.
…d apply minor formatting.
…file template changes
…y include them in the API response based on listener types.
…nt and remove dedicated dynamic config endpoint.
fortuna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simplify how we build outilnecaddy so it's easier to reason about and there's less to maintain. I recommend putting it in a standalone PR so it's not blocked on the rest of the PR
src/shadowbox/Taskfile.yml
Outdated
| vars: [OUTPUT_BASE] | ||
|
|
||
| tasks: | ||
| download_xcaddy: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you just call go run github.com/caddyserver/xcaddy/cmd/xcaddy?
The way we do this is to add it as a tool, like we do here:
https://github.com/Jigsaw-Code/outline-sdk/blob/fa686d9463ac56af75aa846f0b446547e73a38b7/go.mod#L53
Then you can simply call go tool xcaddy, and we get the proper version pinning in the go.mod/sum
That sounds a lot simpler and removes all this code we need to maintain. Can you do the go tool approach instead? It can be in its own PR to speed up the review/approval process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will change this and test it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this? 739d2ec
src/shadowbox/Taskfile.yml
Outdated
| vars: {TARGET_DIR: '{{.BIN_DIR}}'} | ||
| # Set CGO_ENABLED=0 to force static linkage. See https://mt165.co.uk/blog/static-link-go/. | ||
| - GOOS={{.TARGET_OS}} GOARCH={{.GOARCH}} CGO_ENABLED=0 go build -ldflags='-s -w -X main.version=embedded' -o '{{.BIN_DIR}}/' github.com/Jigsaw-Code/outline-ss-server/cmd/outline-ss-server | ||
| - task: download_xcaddy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the download and call go tool xcaddy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fortuna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we are ready to accept this PR. We need to understand how this will play with dynamic access keys. With dynamic keys we don't need to set things for "new keys". We can do it for all keys, simplifying the mental model.
We may want a separate API for dynamic keys, so this needs more discussion.
I encourage you to send the build & CI changes as a PR though.
…ddyWebServerConfig` to `WebServerConfig`
I believe I've fixed all the prior issues now, besides the dynamic access key concerns. I hear your feedback though, and I'm thinking more about it. I'll come up with something for your review. |
This PR adds WebSocket transport support for Shadowsocks connections, enabling SS over WSS to bypass restrictive network filters. It fixes #1676 where much of the work was discussed.
Features
WebSocket Transport Support
GET /access-keys/{id}returns YAML configuration for WebSocket-enabled keys (Outline Client v1.15.0+)websocket-stream) and UDP over WebSocket (websocket-packet)Embedded OutlineCaddy Server
API Changes
New Endpoints
PUT /server/listeners-for-new-access-keys- Configure listener types for new keysPUT /server/web-server- Configure embedded Caddy web serverModified Endpoints
GET /access-keys/{id}- Returns JSON for traditional keys, YAML for WebSocket keysPOST /access-keys- Now acceptslistenersarray parameterAccessKey Schema
listenersfield (tcp,udp,websocket-stream,websocket-packet)dynamicConfigfield for WebSocket transport configurationpassword,port,method,accessUrlare now optional (omitted for WSS-only keys)Build & CI Changes
Docker Build Workflow
amd64andarm64images sequentiallyGitHub Actions Concurrency
build-and-test-*for build workflowlicense-*for license checksTaskfile Changes
download_xcaddytask for cross-platform xcaddy downloadsoutlinecaddy@v0.0.1caddy_yaml_adaptercaddy-l4@v0.0.0-20251201210923-0c96591f5650Dependencies
Go Dependencies (
go.mod,go.sum)prometheus/client_golangto v1.20.5prometheus/commonto v0.62.0oschwald/geoip2-golangto v1.11.0golang.org/x/cryptoto v0.32.0golang.org/x/syncto v0.11.0google.golang.org/protobufto v1.36.4Documentation
README.md
api.yml
GET /access-keys/{id}Usage Examples