Agent doesn't listen to error event on socks client, so if one occurs it goes up to throw from EventListener. I'm not sure about all the cases, but I encountered it while trying to connect to non-existent server.
I've worked around it by listening to error event together with connect event and then providing connect event with fake socket which then sends out error on this fake socket on next tick, while providing fake read and destroy methods. It seems to work for now, however I don't really know the flow of Agent api so I'm afraid to provide this hack as a patch.
Agent doesn't listen to error event on socks client, so if one occurs it goes up to throw from EventListener. I'm not sure about all the cases, but I encountered it while trying to connect to non-existent server.
I've worked around it by listening to error event together with connect event and then providing connect event with fake socket which then sends out error on this fake socket on next tick, while providing fake read and destroy methods. It seems to work for now, however I don't really know the flow of Agent api so I'm afraid to provide this hack as a patch.