New Endpoint Support: Geph5 - #4380
Open
TommyJerryMairo wants to merge 222 commits into
Open
Conversation
Author
|
Oops, fixing branch mismatch now. |
Author
|
Fix merge dropped. |
nekohasekai
force-pushed
the
testing
branch
8 times, most recently
from
August 6, 2026 06:43
1fb7b8c to
0c23cdb
Compare
Author
|
Merged changes from the testing branch. |
TommyJerryMairo
force-pushed
the
dev-geph5_support
branch
2 times, most recently
from
August 6, 2026 11:54
f89febb to
3d983f3
Compare
Author
|
Rebased commit history into latest testing HEAD |
TommyJerryMairo
force-pushed
the
dev-geph5_support
branch
from
August 6, 2026 22:26
3d983f3 to
e509547
Compare
Author
|
Minor fixes in documentation. |
Author
|
Design updated to use Geph5's control port to check the inferior's readiness. |
`SecTrustEvaluateWithError` is serial
Recent Windows 11 builds remove TCP estats, which made writeAndWaitAck return without waiting for acknowledgment. sing now queries SIO_TCP_INFO on the socket instead, and falls back to estats on systems predating it (Windows 10 1703).
Batched darwin packet I/O now also covers connected sockets on iOS.
TommyJerryMairo
force-pushed
the
dev-geph5_support
branch
from
August 8, 2026 11:11
e603e68 to
4ca0a1b
Compare
Author
|
Rebased commit history into latest testing HEAD |
Introduce a Geph5 endpoint that manages geph5-client in stdio VPN mode and connects its packet protocol to sing-box's userspace IP stack. The endpoint: - supports TCP and UDP operations through the endpoint interface; - frames packets using Geph5's 16-bit big-endian length prefix; - manages geph5-client startup, shutdown, and configuration; - requires an explicit Geph configuration path; - prevents overriding Sing-box-managed --config and --stdio-vpn arguments; - rejects unresolved domain destinations; - adds JSON schema, registry integration, tests, and documentation. The endpoint requires a build with the with_gvisor tag.
Require a loopback control address and poll conn_info until Geph reports Connected before exposing the endpoint. Harden startup timeout, process cleanup, stderr diagnostics, and JSON-RPC validation. Add readiness tests and update documentation and schema.
TommyJerryMairo
force-pushed
the
dev-geph5_support
branch
from
August 9, 2026 03:20
4ca0a1b to
c11a51c
Compare
Author
|
Rebased commit history into the latest HEAD on testing |
nekohasekai
force-pushed
the
testing
branch
2 times, most recently
from
August 9, 2026 06:58
9b20d01 to
426c5fa
Compare
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 pull request adds a Geph5 endpoint to sing-box.
Geph5 exposes its VPN transport through a stdio packet protocol. The new endpoint manages the official
geph5-clientprocess and connects its stdin/stdout packet stream to sing-box's userspace IP stack.The endpoint supports TCP and UDP through the normal sing-box endpoint interface. DNS resolution intentionally remains in the sing-box routing layer: Geph receives resolved IP destinations, while domains can be resolved by a route rule before dialing the endpoint.
Configuration
{ "type": "geph", "tag": "geph5", "executable_path": "/usr/bin/geph5-client", "config_path": "/etc/geph5/client.yaml", "control_address": "127.0.0.1:9913", "startup_timeout": "15s", "extra_args": [] }The
config_pathandcontrol_addressfields are required. The control address must be a loopback address, must matchcontrol_listenin the Geph5 configuration, and must be available when the endpoint starts. Because Geph5's TCP control RPC is unauthenticated, it should remain accessible only from the local host.sing-box supplies
--configand--stdio-vpnwhen starting the client and rejects attempts to override those managed arguments throughextra_args.startup_timeoutbounds both process launch and readiness polling. sing-box queries the control RPCconn_infomethod and exposes the endpoint only after Geph reportsConnected.Implementation
gephendpoint and proxy display name.geph5-clientwith context cancellation and lifecycle handling.conn_infoJSON-RPC method until Geph reportsConnected.The endpoint requires a build with
-tags with_gvisor, because the userspace IP stack translates sing-box TCP/UDP operations into Geph5's packet stream.The official Geph exit service applies destination-port restrictions. Those restrictions are lifted for Plus subscribers, so testing an additional outbound proxy chained through the Geph endpoint may require a Plus account.
Testing
The focused Geph tests, race run, vet run, schema validation, and tagged build checks pass.
A repository-wide
go test ./...run also reaches and passes the Geph package. Its remaining failures are unrelated host/toolchain issues: network-namespace creation is not permitted incommon/netns, the test host's/etc/hostsdoes not definelocalhostfordns/transport/hosts, andexperimental/boxddandexperimental/libboxencounter an existingruntime/pprof.parseProcSelfMapslink error.Follow-up scope
To keep this review focused, a follow-up pull request will add opt-in
sing-box check --start-gephvalidation and graceful shutdown through the Geph control RPC. Those changes are intentionally not included in this pull request.Thank you very much for taking the time to review this contribution. Feedback is welcome.