How to handle https.on('connect')? for SSL Keepalive

24 views
Skip to first unread message

Bryan Field-Elliot

unread,
Jan 22, 2015, 9:44:37 AM1/22/15
to nod...@googlegroups.com
I have clients (happens to be on Android) using SSL and keepalive, desiring to make multiple requests on the same connection. I am not sure why this is overloaded as such, but, in between the first and second HTTP requests, the client is sending an HTTP CONNECT message:

CONNECT app.mydomain.com:443 HTTP/1.1
User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.1.1; Z992 Build/JRO03C)
Proxy-Connection: Keep-Alive

I gather that I need to handle this in Node by providing an https on('connect') handler.  But, I'm not sure what to put in this handler, to make the client happy and let the connection continue to operate.  It's not really requesting a proxy to another server, it's just keeping alive the current connection, as far as I can tell.

I tried socket.write("HTTP/1.1 200 OK\r\n\r\n"), but, Node doesn't seem to consider the request handled after this, and doesn't parse any more incoming traffic. There is no "response" object sent to the on('connect') callback, so I can't call response.end().  

Can anyone pelase advise? Get HTTPS and Keepalive to work well is going to be critical for mobile performance.

By the way this is Node 0.10.30.





Reply all
Reply to author
Forward
0 new messages