Listener syntax
Resources that define listeners, such as httpd and scriptPort, use a common syntax to define the address and port to listen on. It is also used by the callback resource to define an address and port to connect to.
Syntax
The syntax of is:
- port
- :port
- address:port
- address
- An optional numeric address. The default is
127.0.0.1
. If an IPv6 address is used, it must be surrounded by square brackets, e.g.,[::1]
. The value*
specifies any IPv4 address (0.0.0.0
). - port
- The TCP port.
Examples
Listen for connections on (or make a connection to) 127.0.0.1, port 8080.
:8080 8080
Listen for connections on any IPv4 address, port 8081.
*:8081
Listen for connections on (or make a connection to) 1.2.3.4, port 8050.
1.2.3.4:8050
Listen for connections on (or make a connection to) IPv6 address ::1, port 8040.
[::1]:8040