close

server.host

  • Type: string
  • Default: localhost

Specify the host that the Rsbuild server listens to.

By default, the Rsbuild server listens on localhost. If you want the Rsbuild server to listen to all IPv4 network interfaces (including public network addresses), you can set it to 0.0.0.0:

rsbuild.config.ts
export default {
  server: {
    host: '0.0.0.0',
  },
};

Alternatively, you can use the --host CLI flag to enable network access on demand:

rsbuild dev --host
Tip

The priority of --host CLI option is higher than server.host.

IPv6 Support

If you want the Rsbuild server to listen all IPv6 network interfaces, you can set it to:

rsbuild.config.ts
export default {
  server: {
    host: '::',
  },
};

If you want the Rsbuild server to listen a specified IPv6 host, you can set it to:

rsbuild.config.ts
export default {
  server: {
    host: '::1',
  },
};

At this point, you can access the page via http://[::1]:3000/.

Version history

VersionChanges
v2.0.0Default value changed from 0.0.0.0 to localhost