greim / hoxy

Web-hacking proxy API for node
http://greim.github.io/hoxy/
MIT License
597 stars 97 forks source link

Cannot read property 'port' of null #101

Open joaomilho opened 7 years ago

joaomilho commented 7 years ago

This happens sometimes when running proxy.close():

/Users/joaomilho/p/klarna-app/services/shopping/node_modules/hoxy/lib/proxy.js:396
            port: addr.port,
                      ^

TypeError: Cannot read property 'port' of null
    at Server.<anonymous> (/Users/joaomilho/p/klarna-app/services/shopping/node_modules/hoxy/lib/proxy.js:396:23)
    at emitTwo (events.js:106:13)
    at Server.emit (events.js:194:7)
    at parserOnIncoming (_http_server.js:563:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)

On mac, node v 7.10.1.

Safi1012 commented 7 years ago

Hi,

I'm also having the same problem. This problem happens for me when Hoxy is receiving requests and tries to shut down at the same time. Unfortunately I can't find a way to tell Hoxy, to stop listening on incoming network calls.

Any help would be much appreciated, thanks!

Node: v7.9.0 macOS (Sierra): 10.12.6