On 2012-01-16 05:07, Christian Biesinger wrote:
> On 1/3/2012 2:36, Piotr Kuśka wrote:
>> W dniu 2011-12-28 18:47, Christian Biesinger pisze:
>>> On Wed, Dec 28, 2011 at 4:43 PM, Piotr Kuśka<
p.kuska@gadu...>
>>> wrote:
>>>> I've tried this approach already, but it wouldn't work with proxy
>>>> authentication (I would have to rewrite the proxy authentication code).
>>>> Also, I wouldn't be able to make a connection to an unsecureproxy and
>>>> then
>>>> upgrade it to ssl.
>>>> I tried to modify nsHttpChannel, nsHttpTransaction and
>>>> nsHttpConnection o
>>>> achieve the desired goal, but with no success.
>>>
>>> True, authentication is a problem. You may want to look at the
>>> websocket code, which has solved that problem too. Upgrading to SSL
>>> would actually work, if you use the "starttls" socket type and then
>>> call nsISSLSocketControl::StartTLS once you want to initiate SSL. You
>>> can get the socket control object from
>>> nsISocketTransport::GetSecurityInfo.
>>>
>>> -christian
>>
>> I tried to do that as well, but the problem is that the server I connect
>> to sends data over the socket once the connection is established. The
>> data is then interpreted as content of the HTTP OK reply from proxy in
>> nsHttpTransaction and it is too late to call StartTLS.
>
> You misunderstood me - I meant not using HTTP channel at all, instead
> directly using nsISocketTransport and sending a CONNECT request by hand.
>
> -christian
I think I understood what you said. I meant that doing what you
suggested would require modifying (or actually rewriting) nsHttpChannel,
because web sockets implementation sends a CONNECT using nsHttpChannel
and not nsISocketTransport directly. Anyway I figured out that it would
be easier to adjust my server infrastructure to use web sockets.
_______________________________________________
dev-tech-network mailing list
dev-tech-network@list...https://lists.mozilla.org/listinfo/dev-tech-network
opensubscriber is not affiliated with the authors of this message nor responsible for its content.