add Shadowsocks (ss://) support#86
Open
Hoot-Code wants to merge 5 commits into
Open
Conversation
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.
Add Shadowsocks (
ss://) supportSummary
This PR adds full Shadowsocks configuration support alongside the existing VLESS and Trojan protocols. Users can now paste a
ss://share URL into the config input and have it scanned and validated like any other protocol.Changes
internal/xraytest/parser.goMethod stringfield toVLESSConfig(holds the cipher, e.g.aes-256-gcm,chacha20-ietf-poly1305)ParseProxyURLto dispatchss://URLs to the new parserParseShadowsocks()supporting both URL formats:ss://BASE64(method:password)@host:port#remarkss://BASE64(method:password@host:port)#remarkToShadowsocksURL()to reconstruct a SIP002 share URL from a parsed configssDecodeUserinfo()andbase64DecodeSS()helpers that tolerate missing padding and both standard/URL-safe base64 alphabetsinternal/xraytest/builder.gobuildOutbound()to dispatch onProtocol == "shadowsocks"buildShadowsocksOutbound()which generates a valid Xrayshadowsocksoutbound block withmethodandpasswordinternal/ui/model.goss://internal/xraytest/parser_test.goParseProxyURL, round-trip viaToShadowsocksURL, and invalid port rejectionSupported ciphers
Any cipher string is accepted (the value is passed through to Xray). Common ones include:
aes-128-gcm·aes-256-gcm·chacha20-ietf-poly1305·xchacha20-ietf-poly1305·2022-blake3-aes-256-gcmTesting
All existing tests continue to pass. New tests cover both URL formats, the dispatch layer, round-trip URL generation, and error handling.