Repository navigation
Add dnstt support
#574
Replies: 3 comments 9 replies
|
It seems the core logic to implement a Once we create a DNS connection we:
Those are all public APIs we can use. The logic to create the DNS connection is in https://repo.or.cz/dnstt.git/blob/644489c1819b2c04cb20e98f30a649deded95b1c:/dnstt-client/main.go#l348. Unfortunately that's all private code in the I'll note that /cc @wkrp |
KCP Analysiskcp-go is production-grade Go implementation of the KCP protocol (A Fast and Reliable ARQ Protocol). KCP is a fast and reliable ARQ (Automatic Repeat reQuest) protocol. It serves as a drop-in replacement for TCP, providing smooth, resilient, ordered, error-checked, and anonymous stream delivery over UDP packets. Key Features:
ArchitectureThe project follows a layered architecture:
The Life of a ConnectionBecause KCP is implemented over UDP, it doesn't have the same strict state machine as TCP. Instead, 1. Establishment (The "Handshake")KCP does not use a traditional 3-way handshake (SYN, SYN-ACK, ACK).
2. Data TransmissionOnce the session is established, data is exchanged via KCP segments.
3. Packet Reception PipelineWhen a client receives a packet, it passes through several layers before reaching the application:
4. Maintenance
5. Termination
The Conversation ID (
|
|
For support in the Outline Client, I propose this plan:
/cc @ohnorobo |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'd like to add support for
dnstt, since it seems to somewhat work in Iran. This post is to make sense of it.Overview
This project is a DNS tunnel that allows you to tunnel TCP traffic over DNS. It consists of two main components: a server (
dnstt-server) and a client (dnstt-client). The tunnel works over DNS over HTTPS (DoH), DNS over TLS (DoT), and plaintext UDP DNS. It uses a custom protocol based on KCP and smux to provide reliable, multiplexed streams over the DNS transport. The connection is encrypted and authenticated using the Noise protocol framework.The server acts as an authoritative DNS server for a specific domain. It listens for DNS queries, decodes the data from the queries, and forwards it to a specified upstream TCP address. The client listens for local TCP connections, encodes the data into DNS queries, and sends them to a DNS resolver.
Running
You can run the client and the server without needing to explicitly clone the repo:
APIs
dnstteffectively works as a TCP reverse proxy, or "port forwarder". It connects the incoming stream to a backend server. In the Outline SDK, that's atransport.StreamEndpoint. For forward proxying, we will need to plug it to a forward proxy (Shadowsocks, SOCKS5, web proxy...)The main entrypoint API is
NewDNSPacketConn:The API can be changed to take a
net.Conninstead ofPacketConnand address, since the address for outgoing packets is fixed (no need for UDP-style WriteTo/ReadFrom).The method is in the
mainpackage ofdnstt-client, so it's not accessible. We will need to duplicate the code in order to use it.More analysis to come...
All reactions