Skip to content
Connection formats

How to write an IPv6 proxy address in a URL

Colons are part of an IPv6 address, while URI syntax also uses a colon to separate the port. To remove this ambiguity, a literal IPv6 host is enclosed in square brackets inside an authority component. Automated proxy exporters must apply this rule deliberately.

2 min readReviewed and updated: August 6, 2026

Key points in one minute

  • An IPv6 literal in a URI is enclosed in square brackets.
  • The port follows the closing bracket.
  • Separate application fields may not require URI brackets.
  • An IPv4 string template is not safe for IPv6 output.

Why brackets are required

URI authority contains a host and an optional port. Without brackets, a parser cannot reliably distinguish IPv6 colons from the port separator. The brackets belong to URI notation; they are not part of the underlying IP address.

Building the correct form

A complete address contains the scheme, [IPv6], and then a colon and port. If a client format permits username and password in userinfo before @, reserved characters require percent-encoding. Keeping fields separate is safer whenever the application supports it.

URI versus application form fields

Some clients expose separate host and port fields. Their host field may expect IPv6 without brackets because the UI already knows where the port belongs. Follow the client's documentation rather than copying URI notation into every form.

Testing an exporter

Test full and compressed IPv6, IPv6 with a port, credentials containing special characters, and both HTTP and SOCKS5 output. A preview should match the exact copied or downloaded value. Validate one result against an authorized control service.

Practical checklist

  1. 1Enclose an IPv6 literal in brackets inside a URI.
  2. 2Place the port after the closing bracket.
  3. 3Percent-encode reserved characters exactly once.
  4. 4Check the application's requirements for a host field.
  5. 5Include IPv6 cases in automated export tests.

Sources and documentation

This material is based on primary, official, and technical sources. The article is an original summary written for this knowledge base.

  1. 1.RFC Editor / IETF: Uniform Resource Identifier: Generic Syntax
  2. 2.RFC Editor / IETF: IP Version 6 Addressing Architecture
  3. 3.curl project: curl URL syntax

Continue reading

More articles on related topics

Protocols

HTTP proxies: what happens to a web request

Read

HTTP and TLS

HTTPS through an HTTP proxy: how CONNECT tunneling works

Read

Protocols

SOCKS5 explained: negotiation, addressing, and relay setup

Read