-
Notifications
You must be signed in to change notification settings - Fork 41
Bind to Specific IP
cetinsert edited this page Sep 6, 2014
·
1 revision
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 p
where
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.