Listening hostname/adapter

By default, Mockoon's mock APIs will listen to all available network adapters, often described as It means that your mock server will be available on all your adapter as localhost,, your local IP address 192.168.x.x, etc. You can configure each environment to listen on, and thus localhost too, by checking a simple option.

Open the Environment Settings by clicking on the tab at the top of the window:

click on the settings tab

Enable the Localhost Only option by ticking the checkbox.

tick the localhost only checkbox

You may need to restart your environment for the change to take effect.

Your mock API will now be available on https://localhost:{port} and{port} only.

When using the CLI, you can choose a specific adapter to listen to (e.g. by using the --hostname flag with the start command.