I trying to extend this module: https://github.com/gildean/node-udp-proxy so it has some kind of method for closing the the proxy when I do not need it anymore. I have tried the following approaches with failure: 1. Trying to extend the code, using inherit. 2. using event emitter to close. 3. Copy the code and extend the module directly by creating the following code in index.js, but I could not manage to call it from the instantiated object.
UdpProxy.prototype.closeClient = function closeClient() {
var proxy = this;
//this.close();
proxy.emit('proxyClose', this.peer);
this.removeAllListeners();
delete proxy.connections[senderD];
}
I didnt get any approachs to work yet. I'm a bit of a node.js newbie. I've been reading different articles about inherit but was unable to get the example to work in my context.
Any guidance appreciated.
Thanks