SagerNet / SagerNet/sing-box

Proposal: Add Nowhere protocol support to sing-box

Open
#4,364 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
38.2k
Forks
4.6k
Avg merge
19d 15h
Merged PRs (30d)
1

Description

Hello,

I would like to ask whether you would be interested in accepting support for the Nowhere protocol in sing-box.

I have already implemented a prototype integration in my sing-box fork:

About Nowhere

Nowhere is a proxy protocol designed around independent uplink and downlink carriers.

Instead of requiring both directions of a connection to use the same transport, the client can independently select the carrier used for:

  • uplink traffic
  • downlink traffic

The currently supported carriers are:

  • TLS over TCP
  • QUIC

This produces four possible carrier combinations:

Uplink Downlink
TLS/TCP TLS/TCP
QUIC QUIC
TLS/TCP QUIC
QUIC TLS/TCP

This asymmetric design can be useful on networks where the uplink and downlink have different characteristics or restrictions. For example, QUIC may work well in one direction while TLS/TCP is more stable in the other direction.

The protocol supports both TCP and UDP proxy flows. Mixed-carrier connections are paired at the protocol layer so that the uplink and downlink can use different physical transports while still representing one logical connection.

Other protocol characteristics include:

  • native TLS/TCP and QUIC carriers
  • independent uplink and downlink carrier selection
  • TCP and UDP proxying
  • mixed-carrier flow pairing
  • connection-bound authentication using TLS exporter material
  • typed target addresses and setup results
  • protocol-level fragmentation and reassembly for UDP traffic
  • client and server implementations

Go implementation

I created nowhere-go as a reusable Go implementation of the protocol.

It contains both:

  • outbound/client support
  • inbound/server support

The library handles the Nowhere wire protocol and session state, while the host application remains responsible for platform-specific components such as:

  • dialers
  • TLS configuration
  • QUIC implementation
  • certificates
  • routing
  • inbound and outbound configuration schemas

The library does not import sing-box and is intended to keep the protocol implementation separated from the host integration.

Current sing-box integration

I have implemented a prototype integration in my fork, including the corresponding sing-box inbound/outbound adapters and configuration handling.

The integration reuses sing-box components where possible, including its dialer, router, TLS, QUIC, and connection lifecycle infrastructure, rather than introducing a second networking stack.

Before preparing a formal pull request, I would like to confirm:

  1. Would Nowhere protocol support be acceptable for upstream sing-box?
  2. Would you prefer the protocol implementation to remain in the external nowhere-go module, or be implemented directly inside the sing-box repository?
  3. Should an initial pull request include both inbound and outbound support, or would you prefer outbound support first?
  4. Are there any architectural, configuration, dependency, testing, or maintenance requirements that should be addressed before submitting the pull request?

I am willing to maintain the integration, add interoperability tests against the original Rust implementation, and adjust the implementation to match sing-box conventions.

Thank you for your time.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the prototype sing-box integration and the reusable nowhere-go implementation, then compare their inbound/outbound adapters and configuration handling with sing-box conventions. Resolve whether the implementation should remain external and whether the initial scope includes both directions. Done means the upstream architecture, dependency, testing, and maintenance requirements are agreed before a formal pull request.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.