i just found a working solution. It seems that my only problem was during
my socket piping:
Old Code:
proxySocket.pipe(serverSocket);
New Code:
proxySocket.pipe(serverSocket, {end: false});
proxySocket.on('end', function () {
serverSocket.emit('end');
});
But i don't quite understand what is the difference between this two
snippets, it would be nice if somebody could explain to me why they don't
do the same thing.
Thanks & Best Regards
Tom
Am Donnerstag, 30. Mai 2013 12:25:55 UTC+2 schrieb Tom:
>
> Hi,
>
> I'm currently trying to implement a proxy server which can handle the
> 'connect' method and also keeps all sockets alive for a specified time.
>
> Its pretty easy to manage keep-alive sockets if i use the http or the
> request module with this agent: https://github.com/TBEDP/agentkeepalive.
>
> But if i want to handle the 'connect' http method i'm creating the socket
> with net.connect(...) and i can't find a good solution to add this socket
> to my agent.
>
>
> I tried to override the http.ClientRequest and use my on 'close' and 'end'
> events, but it doesn't seem to work fine - it also feels really hacky.
>
>
> As i'm pretty new to nodejs, i just wanted to make sure that i'm on the
> right path for this implementation, or if there is any better way todo this.
>
>
> Thanks & Best Regards
> Tom
>
>
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.