Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Listener

The server listener is customizable with config file. In addition, some of them can be overwritten with startup parameter.

Bound addresses

IPv4

Each of them is available:

Condition: listener.ip_addressResult
127.0.0.1 (Loopback)listens to localhost only
LAN address such as 192.168.1.10listens to LAN
0.0.0.0listens to any globally

Example

Modification as below lets server listen to the external instead of localhost. Note that there should be risk on security.

  # apimock.toml
  [listener]
- ip_address = "127.0.0.1"
+ ip_address = "0.0.0.0"

IPv6

IPv6 is available.

Example

Loopback
  # apimock.toml
  [listener]
- ip_address = "127.0.0.1"
+ ip_address = "::1"
Global

Note that there should be risk on security.

  # apimock.toml
  [listener]
- ip_address = "127.0.0.1"
+ ip_address = "::"

It is equivalent to ::0.