<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chance</title>
    <description>The latest articles on DEV Community by Chance (@chancy).</description>
    <link>https://dev.to/chancy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4098723%2Fc6c631fe-1a22-4cae-8aec-2229ade5926d.png</url>
      <title>DEV Community: Chance</title>
      <link>https://dev.to/chancy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chancy"/>
    <language>en</language>
    <item>
      <title>Debugging SOCKS5, DNS, and Developer Tooling Without Guesswork</title>
      <dc:creator>Chance</dc:creator>
      <pubDate>Fri, 28 Aug 2026 10:14:44 +0000</pubDate>
      <link>https://dev.to/chancy/debugging-socks5-dns-and-developer-tooling-without-guesswork-510g</link>
      <guid>https://dev.to/chancy/debugging-socks5-dns-and-developer-tooling-without-guesswork-510g</guid>
      <description>&lt;p&gt;Proxy bugs are often reported as application bugs.&lt;/p&gt;

&lt;p&gt;An API client cannot connect. A package manager works in one terminal but not another. A browser reaches an internal environment while a command-line tool fails. The immediate question is usually, "Is the proxy down?"&lt;/p&gt;

&lt;p&gt;That is rarely enough to diagnose the issue.&lt;/p&gt;

&lt;p&gt;For developers, the useful question is: where is name resolution happening, and which process is actually using the proxy?&lt;/p&gt;

&lt;p&gt;This article walks through a practical way to reason about SOCKS5 connectivity in local development environments. The goal is not to add a proxy to every command, but to make network behavior visible and repeatable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Three Paths in a Request
&lt;/h2&gt;

&lt;p&gt;When an application calls &lt;code&gt;https://api.example.com&lt;/code&gt;, three things may happen independently:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The hostname is resolved to an IP address.&lt;/li&gt;
&lt;li&gt;A TCP connection is opened.&lt;/li&gt;
&lt;li&gt;TLS is negotiated and the HTTP request is sent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A SOCKS5 configuration may affect the connection path without affecting DNS resolution. That distinction explains a large share of confusing results.&lt;/p&gt;

&lt;p&gt;If DNS is resolved locally, your workstation asks its configured resolver for &lt;code&gt;api.example.com&lt;/code&gt; before it contacts the SOCKS proxy. If remote DNS is enabled, the hostname is passed to the proxy and resolution happens from the proxy's network context.&lt;/p&gt;

&lt;p&gt;The two paths can return different answers for region-specific services, split-horizon DNS, private environments, and content-delivery networks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Establish a Baseline First
&lt;/h2&gt;

&lt;p&gt;Before changing environment variables or application settings, record what works without a proxy.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Resolve-DnsName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;api.github.com&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Test-NetConnection&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;api.github.com&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;443&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On macOS or Linux, the equivalent checks can be run with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig api.github.com
curl &lt;span class="nt"&gt;-Iv&lt;/span&gt; https://api.github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This baseline matters. Without it, a later failure could be caused by the proxy, local DNS, a firewall rule, or the target service itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test the SOCKS5 Tunnel Separately
&lt;/h2&gt;

&lt;p&gt;Use a small, explicit request before involving an IDE, a browser profile, or a package manager.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--proxy&lt;/span&gt; socks5h://USER:PASSWORD@HOST:PORT https://api.ipify.org
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;h&lt;/code&gt; in &lt;code&gt;socks5h&lt;/code&gt; is important: it asks &lt;code&gt;curl&lt;/code&gt; to send the hostname through the SOCKS proxy for remote DNS resolution. Use &lt;code&gt;socks5://&lt;/code&gt; when you intentionally want local DNS resolution instead.&lt;/p&gt;

&lt;p&gt;For a hosted endpoint, &lt;a href="https://socks5.io/" rel="noopener noreferrer"&gt;SOCKS5.io&lt;/a&gt; is one service developers can evaluate when testing authenticated SOCKS5 connectivity.&lt;/p&gt;

&lt;p&gt;Keep this test focused. It confirms that authentication, tunneling, DNS behavior, and outbound TLS can work together before the proxy is introduced into a larger toolchain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid Global Proxy Settings During Investigation
&lt;/h2&gt;

&lt;p&gt;System-wide proxy settings are convenient, but they make debugging harder. Background processes, browser extensions, update services, and unrelated applications may start using the proxy at the same time.&lt;/p&gt;

&lt;p&gt;Prefer a process-scoped configuration while diagnosing a problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$&lt;/span&gt;&lt;span class="nn"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nv"&gt;ALL_PROXY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'socks5h://USER:PASSWORD@HOST:PORT'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;curl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;https://api.ipify.org&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;Remove-Item&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Env:ALL_PROXY&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a Node.js script, create an agent in the application instead of relying on an inherited shell setting. That makes the network dependency obvious in source control and in CI configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;SocksProxyAgent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;socks-proxy-agent&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SocksProxyAgent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;socks5h://USER:PASSWORD@HOST:PORT&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.ipify.org?format=json&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;agent&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a secret manager or CI secret store for credentials. Do not commit proxy URLs containing usernames or passwords.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know Which Tools Honor Which Variables
&lt;/h2&gt;

&lt;p&gt;There is no universal proxy environment variable behavior.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Typical configuration&lt;/th&gt;
&lt;th&gt;Common surprise&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;curl&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;--proxy&lt;/code&gt; or &lt;code&gt;ALL_PROXY&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;DNS behavior changes between &lt;code&gt;socks5&lt;/code&gt; and &lt;code&gt;socks5h&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Git&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;http.proxy&lt;/code&gt; configuration&lt;/td&gt;
&lt;td&gt;SSH remotes do not use the HTTP proxy setting.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;npm&lt;/td&gt;
&lt;td&gt;npm proxy configuration&lt;/td&gt;
&lt;td&gt;Registry traffic and lifecycle scripts may behave differently.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Docker&lt;/td&gt;
&lt;td&gt;daemon or build configuration&lt;/td&gt;
&lt;td&gt;Container networking is separate from the host shell.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Browser automation&lt;/td&gt;
&lt;td&gt;browser launch arguments&lt;/td&gt;
&lt;td&gt;The browser may use its own DNS and cache behavior.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Document the exact scope of each setting in the repository's development guide. A short note such as "Run integration tests with &lt;code&gt;ALL_PROXY&lt;/code&gt; set" saves considerable time for the next person who encounters the same environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Treat Certificates as a Separate Problem
&lt;/h2&gt;

&lt;p&gt;A SOCKS5 proxy tunnels TCP traffic. It does not normally inspect or replace TLS certificates.&lt;/p&gt;

&lt;p&gt;If a request fails with a certificate error after adding a SOCKS proxy, investigate these separately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The system clock&lt;/li&gt;
&lt;li&gt;The local certificate store&lt;/li&gt;
&lt;li&gt;A corporate TLS-inspection gateway elsewhere on the network&lt;/li&gt;
&lt;li&gt;An incomplete certificate chain from the target service&lt;/li&gt;
&lt;li&gt;A development server using a self-signed certificate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Disabling certificate validation may make a test appear to work, but it removes the signal needed to find the actual problem. Keep certificate validation enabled and fix the trust issue directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make Network Context Observable
&lt;/h2&gt;

&lt;p&gt;For repeatable debugging, log the non-sensitive parts of the network context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;request_id=8aaf0d4a
proxy_mode=socks5h
target_host=api.example.com
connect_timeout_ms=5000
response_status=200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Avoid logging credentials, full proxy URLs, authorization headers, cookies, or user data. The point is to determine whether two requests took the same path, not to create a record of secrets.&lt;/p&gt;

&lt;p&gt;In CI, emit the proxy mode and target host only when a job runs in an approved network configuration. This gives maintainers enough context to separate a code regression from an environment regression.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Compact Troubleshooting Order
&lt;/h2&gt;

&lt;p&gt;When a proxied developer tool fails, work through the checks in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Confirm the target works without the proxy.&lt;/li&gt;
&lt;li&gt;Test the SOCKS endpoint with a minimal &lt;code&gt;curl&lt;/code&gt; request.&lt;/li&gt;
&lt;li&gt;Decide whether DNS should be local (&lt;code&gt;socks5&lt;/code&gt;) or remote (&lt;code&gt;socks5h&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Apply the proxy to one process, not the entire operating system.&lt;/li&gt;
&lt;li&gt;Verify the tool actually honors the chosen configuration.&lt;/li&gt;
&lt;li&gt;Investigate TLS failures independently of proxy routing.&lt;/li&gt;
&lt;li&gt;Remove temporary credentials and environment variables after testing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This sequence turns an ambiguous networking problem into a small set of verifiable assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing Thought
&lt;/h2&gt;

&lt;p&gt;SOCKS5 is most useful in development when it is explicit: explicit DNS behavior, explicit process scope, explicit credentials, and explicit diagnostics.&lt;/p&gt;

&lt;p&gt;That discipline is more valuable than any single proxy setting. It gives a team a repeatable method for diagnosing local, CI, and remote-environment connectivity issues without turning every network failure into a mystery.&lt;/p&gt;

</description>
      <category>debugging</category>
      <category>devops</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
