Skip to content

[Bug]: macOS SOCKS5 DNS mapping fails to recover hostnames for IPv6 destinations #311

Backlog

Description

@homanw104

Platform

macOS

ProxyBridge Version

4.1.3

OS and Version

macOS 27.2.1 Golden Gate

Documentation

  • I have read the ProxyBridge documentation for my platform, including the troubleshooting information
  • I have searched the existing issues and did not find this problem reported

Code Review

  • I have gone through the code page

Describe the Bug

When routing Google Antigravity through a SOCKS5 proxy on macOS, ProxyBridge appears to fail to associate intercepted IPv6 destination addresses with their original domain names.

As a result, the SOCKS5 proxy receives an IPv6 address instead of the hostname. This causes the connection to fail when the upstream proxy endpoint is IPv4-only and cannot connect to IPv6 destinations.

Expected behavior:

When Proxy → Enable DNS and Let proxy resolve DNS (send hostname) are both enabled, ProxyBridge should forward the original hostname to the SOCKS5 proxy, regardless of whether the intercepted connection's destination is IPv4 or IPv6.

Actual behavior:

While IPv4 destinations are correctly converted back to hostnames and forwarded to the SOCKS5 proxy, IPv6 destinations remain numeric IPv6 addresses in the connection logs and appear to be forwarded as IP addresses rather than hostnames.

Connections consequently fail when the upstream SOCKS5 proxy only supports IPv4 connectivity.

Host-related rules may also fail in this situation.

Steps to Reproduce

  1. Configure an IPv4-only SOCKS5 proxy server in ProxyBridge.
  2. Enable Proxy → Enable DNS.
  3. Open the SOCKS5 proxy settings and enable Let proxy resolve DNS (send hostname).
  4. Create a rule to route Google Antigravity's processes, including language_server, through that proxy.
  5. Launch Google Antigravity and trigger requests to Google APIs.
  6. Inspect the ProxyBridge Connections view and the upstream SOCKS5 proxy logs.
  7. Observe that IPv4 destinations are forwarded as hostnames, while IPv6 destinations are forwarded as numeric IPv6 addresses.

Your Rules

Applications: language_server
Target Hosts: *
Target Ports: *
Protocol: Both
Action: Proxy → Clash
Also proxy localhost traffic: off

Your Proxy Server

Type: SOCKS5
Location: 127.0.0.1:7897
Authentication: none
Software: Clash Verge Rev
Upstream connectivity: IPv4-only; the server cannot establish connections to IPv6 destinations.

Your Setup

VPN: none
Security software: none
Other tools: none
Network: home Wi-Fi

Logs and Screenshots

[TCP] language_server → 2001:4860:4843:400:::443 → SOCKS5 127.0.0.1:7897

Before you submit

  • I have filled in my rules, proxy server and setup above, and removed any passwords or private data. I understand that a report without these details cannot be verified and may be closed without a reply.

Additional Context

I suspect this may be related to how ProxyBridge stores and looks up IPv6-to-domain mappings.

From the source code, DNSProxyProvider.swift appears to construct IPv6 addresses as fully expanded hexadecimal strings when recording DNS responses. However, the destination address received by the Network Extension may use a compressed IPv6 representation.

For example, these are equivalent IPv6 addresses but different strings:

2001:4860:4843:400:0:0:0:0
2001:4860:4843:400::

If DNSMapStore uses string equality for its lookup keys without canonicalizing IPv6 addresses, the lookup could fail even though both strings represent the same address.

This is a hypothesis rather than a confirmed root cause, but it seems consistent with the observed behavior.

Related issue: #276 addresses failed SOCKS5 connection handling and IPv4 fallback behavior. This report concerns a different problem: IPv6 destinations not being translated back into hostnames in the first place.

Activity

  1. added
    bug
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MacOSbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions