[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #6733 [Firefox Patch Issues]: Patch Firefox to allow addons to set SOCKS username+password per request



#6733: Patch Firefox to allow addons to set SOCKS username+password per request
----------------------------------+-----------------------------------------
 Reporter:  mikeperry             |          Owner:  benb             
     Type:  enhancement           |         Status:  needs_information
 Priority:  major                 |      Milestone:                   
Component:  Firefox Patch Issues  |        Version:                   
 Keywords:  interview             |         Parent:  #3455            
   Points:                        |   Actualpoints:                   
----------------------------------+-----------------------------------------

Comment(by ben):

 Data flow:
 My first approach would be to extend nsIProxyInfo with username and
 hostname, then to let nsISocketProvider.newSocket()/addToSocket() accept
 nsIProxyInfo instead of individual proxy values. This allows to pass the
 username from nsSocketTransport2.cpp to nsISOCKSIOLayer.cpp, which
 implements SOCKS and can send the username to the proxy.

 Before nsSocketTransport: Luckily,
 nsISocketTransportService.createTransport() already accepts nsIProxyInfo.
 createTransport is called directly by the protocol implementations
 including http. nsHttpChannel implements nsIProxiesChannel, which allows
 access to the nsIProxyInfo.

 So, you should be able to:
 var httpChannel = .....QueryInterface(Ci.nsIHttpChannel);
 assert(httpChannel instanceof Ci.nsIHttpChannel);
 assert(httpChannel instanceof Ci.nsIProxiedChannel);
 var proxy = httpChannel.proxyInfo;
 proxy.username = "abc";
 proxy.password = "def";

 I have yet to verify *when* you would have to do that, and whether the
 APIs allows you to do that at all before the proxy connection is
 physically opened.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6733#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs