On this page

C

net.SocketAddress

History
C

net.SocketAddress Constructor

History
new net.SocketAddress(options?): net.SocketAddress
Attributes
options:Object
address:string
The network address as either an IPv4 or IPv6 string. Default: '127.0.0.1' if family is 'ipv4'; '::' if family is 'ipv6'.
family:string
One of either 'ipv4' or 'ipv6'. Default: 'ipv4'.
flowlabel:number
An IPv6 flow-label used only if family is 'ipv6'.
port:number
An IP port.
P

socketaddress

History
Type:string
P

socketaddress.family

History
Type:string
Either 'ipv4' or 'ipv6'.
P

socketaddress.flowlabel

History
Type:number
P

socketaddress.port

History
Type:number
M

SocketAddress.parse

History
SocketAddress.parse(input): net.SocketAddress
Attributes
input:string
An input string containing an IP address and optional port, e.g. 123.1.2.3:1234 or [1::1]:1234.
Returns a SocketAddress if parsing was successful. Otherwise returns undefined.