Listen to the `secureConnection` event instead of the `connection` event. That'll give you the cleartextStream as an argument.
On Thu, Apr 11, 2013 at 1:55 PM, Mark Jones <[email protected]> wrote: > Ben, > > Thanks for the hints. It is nice to see that others have raised this though > it is not clear if and when it will be included (it would be nice if it was > just included in a 0.10.? release soon instead of waiting all the way to > 0.12.0 - or at least for me the CALDAV methods of MKCALENDAR, ACL and > SCHEDULE. > > I looked at and tried node-parsley but did not have much luck. It didn't > seem to handle the http continue request very well and I would have to > collect the whole request before sending it on which seemed a little heavy. > > I also tried something like the following: > > server.on('connection',function(stream){ > var receiveBuffer = new Buffer(0); > > stream.on("connect",function(){ > console.log('stream connected'); > }); > > originalOnDataFunction = stream.ondata; > stream.ondata = function (d, start, end) { > //edit the method here i.e. change MKCALENDAR to MKCOL in the stream > and let my code work out the difference i.e. maybe add /MKCALENDAR to the > requested URL (or another method) > }; > }); > > However, in the above example the server is a https server (fully setup and > running - actually we are using it in a live production environment), and > the stream is encrypted and I cannot get access to the text in the stream. > If I could I could just change the string as described in the comment then > set stream.ondata=originalOnDataFunction again and let everything proceed as > normal - very efficient. > > Unless there is a way to get the unencrypted stream at that point I can't > see another way to do it. Just to use an apache server in the meantime > (hate the thought of going back to apache) and wait for the changes to come > into node. > > Thanks for all the great work - love node :) > > Mark > > > On Tuesday, April 9, 2013 4:12:59 PM UTC+1, Ben Noordhuis wrote: >> >> On Tue, Apr 9, 2013 at 4:56 PM, Mark Jones <[email protected]> >> wrote: >> > I am attempting to create a CALDAV server for which node.js is a reverse >> > proxy. CALDAV has some extended (or custom) HTTP request methods and >> > these >> > seem to cause a problem in node. The method in question for me is >> > MKCALENDAR. When I make a request with this request method in the >> > header >> > the request just seems to die with no error or response at all. >> > Is there a work around for this? >> > >> > Thanks >> > >> > Mark >> >> Custom HTTP methods aren't supported right now (but see [1]). There >> is a pull request for the http-parser component[2] but admittedly >> review kind of stalled. Mea culpa. >> >> There are ways around the current limitation - mostly by intercepting >> and rewriting the first few bytes of the request - but they require >> knowledge of node.js internals and are likely to break on the next >> upgrade. >> >> Something like [3] may be a good solution for you. >> >> [1] https://github.com/joyent/node/issues/3192 >> [2] https://github.com/joyent/http-parser/pull/145 >> [3] https://github.com/substack/node-parsley > > -- > -- > 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. > > -- -- 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.
