Bind to Specific IP - corsis/PortFusion GitHub Wiki
Starting with version 1.1, it is possible to specify a single numeric IPv6 or IPv4 address along with the usual port number for PortFusion server sockets.
This extension uses the AddrPort data structure and can be used at the following places in command line segments:
] A [ # A: AddrPort
p h - p h [ A # p: Port
A ] h p - h p # h: Host
A ] - h pwhere
AddrPort → Port | IP:Port
When no IP is provided in an AddrPort, [::] is used for IPv6+4, IPv6 and 0.0.0.0 for IPv4 to listen on all addresses.
| Listen | all IPs | one IP |
|---|---|---|
| IPv6(+4¹) |
1234 [::]:1234 :::1234² |
[::1]:1234 ::1:1234² |
| IPv4 | 0.0.0.0:1234 |
127.0.0.1:1234 [127.0.0.1]:1234² |
¹ except on Windows XP (no dual stack IP) and FreeBSD
² non-standard syntax allowed for consistency and the shell on FreeBSD
This feature was implemented as an answer to a question by a commercial PortFusion user.
