diff --git a/examples/client_http_proxy/client_http_proxy.js b/examples/client_http_proxy/client_http_proxy.js index 8a98d13..ff72db3 100644 --- a/examples/client_http_proxy/client_http_proxy.js +++ b/examples/client_http_proxy/client_http_proxy.js @@ -15,6 +15,7 @@ const req = Http.request({ method: 'CONNECT', path: process.argv[2] + ":" + parseInt(process.argv[3]) }); +req.end(); req.on("connect", function(res, stream) { const client = mc.createClient({ diff --git a/src/client/tcp_dns.js b/src/client/tcp_dns.js index f0b5c33..834610a 100644 --- a/src/client/tcp_dns.js +++ b/src/client/tcp_dns.js @@ -8,6 +8,7 @@ module.exports = function(client, options) { options.connect = (client) => { if (options.stream) { client.setSocket(options.stream); + client.emit('connect'); } else if (options.port == 25565 && net.isIP(options.host) === 0) { dns.resolveSrv("_minecraft._tcp." + options.host, function(err, addresses) { if(addresses && addresses.length > 0) {