Skip to content

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

@zhangsan946

Description

@zhangsan946

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

Loading

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions