You can change the --server
command line argument on ganache
:
Server:
--server.ws Enable a websocket server. [boolean] [default: true]
--server.wsBinary Whether or not websockets should response with binary data (ArrayBuffers) or
strings. [choices: "true", "false", "auto"] [default: auto]
--server.rpcEndpoint Defines the endpoint route the HTTP and WebSocket servers will listen on.
[default: "/" (Ethereum), "/rpc/v0" (Filecoin)]
--server.chunkSize For memory and performance reasons ganache may respond with chunked
transfer-encoding over HTTP and fragmented send over WebSockets. This option
allows you to control the approximate size of each chunk.
[number] [default: 1048576]
-h, --server.host, --host, --hostname Hostname to listen on.
deprecated aliases: --host, --hostname
[string] [default: "127.0.0.1"]
-p, --server.port, --port Port to listen on.
deprecated aliases: --port
[number] [default: 8545]
Options:
-?, --help Show help [boolean]
--version Show version number [boolean]
In TCP/IP when you set --server 0.0.0.0
it will listen to all IP addresses, not just localhost. This includes any public IP addresses your computer has.
This is not limited to ganache
, but is how TCP/IP protocol and applications work.