Hello! Yes, this is possible. But you'll need to remove either `request` or `connection` event handler (I prefer latter one), save it, and call it if the HTTPS handler should be activated.
That's how I do it in node-spdy: https://github.com/indutny/node-spdy/blob/master/lib/spdy/server.js#L91 Cheers, Fedor. On Tue, Dec 17, 2013 at 11:17 AM, Joran Dirk Greef <jo...@ronomon.com> wrote: > I have an HTTPS server that handles HTTPS and WebSocket traffic. > > I would like to use this same server to handle an additional TCP-based > protocol and would like to do this using NPN rather than Upgrade, to save > RTT. > > I tried using NPNProtocols as a server option and then listening for the > secureConnection event and checking the npnProtocol of the socket and then > passing it off to my custom protocol parser, but it looks like the HTTPS > parser is still bound to the socket, so that any data received automatically > closes the socket. > > Is there a way, apart from using the Upgrade event, to tell Node to stop > parsing the socket as HTTPS? > > -- > -- > 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 nodejs@googlegroups.com > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com > 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 nodejs+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com 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 nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.