shadowsocks / shadowsocks/shadowsocks-rust

[Feature Request] Intercept specifc dns request in tun UDP packet handler

Open
#1,979 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
10.9k
Forks
1.5k
Avg merge
4d 15h
Merged PRs (30d)
5

Description

If sslocal supports to handle the specific DNS requests(e.g. specific (ip:port) UDP packets) separately(may leverage the built-in DNS capability) on TUN interface, Shadowsocks-android can get rid of tun2socks lib totally.

The whole ideas is:

sequenceDiagram
    participant A as Browser
    box Grey Shadowsock-Android
    participant J as Java Code
    participant R as Rust Lib
    end
    participant I as Internet
    J->>+R: VpnService, AddDnsServer(e.g.10.10.10.2), build and getFd and send it out
    R->>+J: Create Tun with FD, Notify when ready to serve
    A-->>R: DNS request(system should use 10.10.10.2 as DNS Server)
    R->>R: Intercept the DNS packet(UDP packet to 10.10.10.2:53) and process with built-in DNS handler
    R->>J: Protect Socket
    R-->>+I: DNS Request(RAW or encrypted)
    I-->>+R: DNS Response(RAW or encrypted)
    R-->>A: Relay DNS Response
    A-->>+R: Http request
    R->>R: Routing
    R->>J: Protect Socket
    R-->>+I: Http Request(RAW or encrypted)
    I-->>+R: Http Response(RAW or encrypted)
    R-->>A: Relay HTTP Response

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

No file, test, or entry point is named. Start by locating the TUN UDP packet handler and the built-in DNS capability, then clarify how configured DNS addresses, socket protection, and response relaying should integrate. Done requires an agreed design and tests covering interception of the specified DNS packets without disrupting normal routing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.