diff --git a/src/consumer.mjs b/src/consumer.mjs index 12ba4e5..e57b098 100644 --- a/src/consumer.mjs +++ b/src/consumer.mjs @@ -10,7 +10,7 @@ export default class Consumer extends Socket { // set or tcp socket if (typeof(path)!=='string') { opts = path - this.host = opts.host || '127.0.0.1' + this.host = opts.host || '127.0.0.1' // TODO log a warning about host on same machine this.port = opts.port || 8080 } else this.path = path this.packet = { @@ -46,9 +46,7 @@ export default class Consumer extends Socket { async connect (context) { if (context) this.packet.context = context - - // console.log('consumer processing=>',app.pp,'=>', app[app.pp]) - // console.log('========================') + else this.packet.context = this this.listen() this.log.info('listening') diff --git a/src/socket.mjs b/src/socket.mjs index 62b45fe..59d6279 100644 --- a/src/socket.mjs +++ b/src/socket.mjs @@ -12,7 +12,7 @@ export default class Socket extends Server { // set or tcp socket if (typeof(path)!=='string') { opts = path - this.listen_opts = { host: opts.host || '127.0.0.1', port: opts.port || 8080} + this.listen_opts = { host: opts.host || '0.0.0.0', port: opts.port || 8080} } else this.listen_opts = { path: path } // default packet processing this.packet = { @@ -36,6 +36,7 @@ export default class Socket extends Server { async create (context) { if (context) this.packet.context = context + else this.packet.context = this return new Promise( async (resolve,reject) => {