add host to ethsim options

pull/5370/head
Iuri Matias 6 years ago
parent 7359cf5d08
commit 1a26d8f7ad
  1. 3
      remix-simulator/bin/ethsim
  2. 4
      remix-simulator/src/server.js

@ -21,9 +21,10 @@ program
program program
.option('-p, --port [port]', 'specify port') .option('-p, --port [port]', 'specify port')
.option('-b, --ip [host]', 'specify host')
.parse(process.argv) .parse(process.argv)
const Server = require('../src/server') const Server = require('../src/server')
const server = new Server() const server = new Server()
server.start(program.port || 8545) server.start(program.host || '127.0.0.1', program.port || 8545)

@ -10,7 +10,7 @@ class Server {
this.provider = new Provider() this.provider = new Provider()
} }
start (port) { start (host, port) {
expressWs(app) expressWs(app)
app.use(bodyParser.urlencoded({extended: true})) app.use(bodyParser.urlencoded({extended: true}))
@ -40,7 +40,7 @@ class Server {
}) })
}) })
app.listen(port, () => log('Remix Simulator listening on port ' + port)) app.listen(port, host, () => log('Remix Simulator listening on port ' + host + ':' + port))
} }
} }

Loading…
Cancel
Save