Re: [Factor-talk] adding http proxy support

2016-02-19 Thread Jon Harper
On Fri, Feb 19, 2016 at 4:05 PM, Jon Harper  wrote:
> So right now the ssl/tls is an optional dependency for the http
> client. If we want to keep it that way, then I think the best solution
> is to split io.sockets.secure into an io.sockets.secure-api which
> defines the hooks and io.sockets.secure-loader that requires the
> correct vocabulary based on the OS. See this paste for a patch:
> http://paste.factorcode.org/paste?id=3842 (I haven't updated all the
> files using io.sockets.secure, just enough to compile what was loaded
> in my image)
Or simply add new hooks in io.sockets that are implemented in
io.sockets.secure for the functionnality that we need optional:
http://paste.factorcode.org/paste?id=3842#1651
I'm going to do that for now since it's such a minimal change..

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] adding http proxy support

2016-02-19 Thread Benjamin Pollack
On Fri, Feb 19, 2016, at 10:05 AM, Jon Harper wrote:
[snip]
> But do we want to keep it as an optional dependency for the http client ?
> Note that ssl/tls is *not* optional for other vocabularies:
> clients: smtp, imap
> servers: io.servers, furnace.auth
> 

I can't think of any reason we wouldn't want it to be mandatory at this
point. Even within data centers, raw, unencrypted HTTP is becoming very
rare between servers, so the only use case where you want HTTP, but
don't need HTTPS, would seem to be serving Factor from behind an SSL
terminator in a situation where Factor itself never needed to talk to
any other web service. This seems like a sufficient edge-case that it's
not desirable.

--Benjamin

--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] adding http proxy support

2016-02-19 Thread Jon Harper
I worked on this, and now I have to so something about the dependency
on io.sockets.secure vocabulary (I need to use send-secure-handshake
from http://docs.factorcode.org/content/article-ssl-upgrade.html for
https over a proxy)

So right now the ssl/tls is an optional dependency for the http
client. If we want to keep it that way, then I think the best solution
is to split io.sockets.secure into an io.sockets.secure-api which
defines the hooks and io.sockets.secure-loader that requires the
correct vocabulary based on the OS. See this paste for a patch:
http://paste.factorcode.org/paste?id=3842 (I haven't updated all the
files using io.sockets.secure, just enough to compile what was loaded
in my image)

But do we want to keep it as an optional dependency for the http client ?
Note that ssl/tls is *not* optional for other vocabularies:
clients: smtp, imap
servers: io.servers, furnace.auth

And the next questions are, do we want to make it optional for the
other clients ?
Optional for the servers ?
Jon


On Fri, Feb 5, 2016 at 6:33 PM, John Benediktsson  wrote:
> Sounds good!  Maybe you can make a pull request and we can figure that out
> later.
>
>
> On Fri, Feb 5, 2016 at 8:05 AM, Jon Harper  wrote:
>>
>> I don't really know, but
>>
>> http://stackoverflow.com/questions/15460819/what-is-the-difference-between-connection-and-proxy-connection-in-http-header
>> says that "Connection" and "Proxy-Connection" are the same, and factor
>> sends "Connection: close", curl send "Proxy-Connection: Keep-Alive"
>> and wget sends nothing.. That's why I wanted to know if someone who
>> know HTTP well had comments... Also the port in the "Host" header is
>> omitted by factor but set by wget and curl
>> Jon
>>
>>
>> On Fri, Feb 5, 2016 at 4:58 PM, John Benediktsson 
>> wrote:
>> > Looks like curl sends a Proxy-Connection, which since you know you're
>> > using
>> > a proxy you could set in the request?
>> >
>> > On Fri, Feb 5, 2016 at 7:32 AM, Jon Harper 
>> > wrote:
>> >>
>> >> I had environnement variables in mind as well but forgot to show them
>> >> in
>> >> the examples. So the full list would be:
>> >>
>> >> ! at factor startup
>> >> ./factor -http.proxy=http://localhost:3128
>> >> or http_proxy="http://localhost:3128"; ./factor
>> >>
>> >> ! using variables
>> >> or "http://localhost:3128"; "http.proxy" set-global
>> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
>> >>
>> >> ! Manually making the request
>> >> or  ... URL" http://localhost:3128"; >>proxy
>> >>
>> >>
>> >>
>> >> I also looked into https, it worked with send-secure-handshake
>> >> (http://docs.factorcode.org/content/article-ssl-upgrade.html ), here's
>> >> a
>> >> proof of concept patch: http://paste.factorcode.org/paste?id=3826#1645
>> >> However, looking at the http headers, they are different than what wget
>> >> or
>> >> curl sends, so I'm not sure if it's correct yet (it worked with squid
>> >> as the
>> >> proxy and https//www.google.fr/ as the server). Can anyone comment on
>> >> whether everything's ok ?
>> >>
>> >>
>> >>
>> >> Le 4 févr. 2016 18:01, "John Benediktsson"  a écrit :
>> >> >
>> >> > It might be nicer to use environment variables rather than python
>> >> > string
>> >> > global variables, for example how Python does it:
>> >> >
>> >> > $ http_proxy=http://10.0.0.1 python -c "import urllib; print
>> >> > urllib.getproxies()"
>> >> > {'http': 'http://10.0.0.1'}
>> >> >
>> >> > We could also get fancier and have OS specific lookup like Python
>> >> > does
>> >> > for OS X and Windows as a fallback:
>> >> >
>> >> > https://docs.python.org/2/library/urllib.html#urllib.getproxies
>> >> >
>> >> >
>> >> > On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper 
>> >> > wrote:
>> >> >>
>> >> >> Hi list,
>> >> >> I'm planning to add http proxy support to http.client. Here's the
>> >> >> API
>> >> >> I thought of, please feel free to give some feedback :)
>> >> >>
>> >> >> - add a "proxy" slot to the request object. (Or maybe subclass
>> >> >> request
>> >> >> as client-request and only add that slot to client ? I think that
>> >> >> would be better for maintenance, but it's a bigger change. What do
>> >> >> you
>> >> >> think ?)
>> >> >>
>> >> >> - use string global variables (*not* SYMBOL:, so that one can set it
>> >> >> from the command line) or set the request slot directly so that one
>> >> >> can do:
>> >> >> ./factor -http.proxy=http://localhost:3128
>> >> >> or "http://localhost:3128"; "http.proxy" set-global
>> >> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ]
>> >> >> with-variable
>> >> >> or  ... URL" http://localhost:3128"; >>proxy
>> >> >>
>> >> >> - the "http.proxy", "https.proxy" and "no_proxy" variables are used
>> >> >> to
>> >> >> fill the proxy slot of the request when using   (so
>> >> >> http-get, etc all have it)
>> >> >>
>> >> >> - use the "http_proxy" "https_proxy" "no_proxy" environnement
>> >> >> variable
>> >> >> as a last resort. I don't know about windows and macosx ?
>> >> >>
>> >> >

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread John Benediktsson
Sounds good!  Maybe you can make a pull request and we can figure that out
later.


On Fri, Feb 5, 2016 at 8:05 AM, Jon Harper  wrote:

> I don't really know, but
>
> http://stackoverflow.com/questions/15460819/what-is-the-difference-between-connection-and-proxy-connection-in-http-header
> says that "Connection" and "Proxy-Connection" are the same, and factor
> sends "Connection: close", curl send "Proxy-Connection: Keep-Alive"
> and wget sends nothing.. That's why I wanted to know if someone who
> know HTTP well had comments... Also the port in the "Host" header is
> omitted by factor but set by wget and curl
> Jon
>
>
> On Fri, Feb 5, 2016 at 4:58 PM, John Benediktsson 
> wrote:
> > Looks like curl sends a Proxy-Connection, which since you know you're
> using
> > a proxy you could set in the request?
> >
> > On Fri, Feb 5, 2016 at 7:32 AM, Jon Harper 
> wrote:
> >>
> >> I had environnement variables in mind as well but forgot to show them in
> >> the examples. So the full list would be:
> >>
> >> ! at factor startup
> >> ./factor -http.proxy=http://localhost:3128
> >> or http_proxy="http://localhost:3128"; ./factor
> >>
> >> ! using variables
> >> or "http://localhost:3128"; "http.proxy" set-global
> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
> >>
> >> ! Manually making the request
> >> or  ... URL" http://localhost:3128"; >>proxy
> >>
> >>
> >>
> >> I also looked into https, it worked with send-secure-handshake
> >> (http://docs.factorcode.org/content/article-ssl-upgrade.html ), here's
> a
> >> proof of concept patch: http://paste.factorcode.org/paste?id=3826#1645
> >> However, looking at the http headers, they are different than what wget
> or
> >> curl sends, so I'm not sure if it's correct yet (it worked with squid
> as the
> >> proxy and https//www.google.fr/ as the server). Can anyone comment on
> >> whether everything's ok ?
> >>
> >>
> >>
> >> Le 4 févr. 2016 18:01, "John Benediktsson"  a écrit :
> >> >
> >> > It might be nicer to use environment variables rather than python
> string
> >> > global variables, for example how Python does it:
> >> >
> >> > $ http_proxy=http://10.0.0.1 python -c "import urllib; print
> >> > urllib.getproxies()"
> >> > {'http': 'http://10.0.0.1'}
> >> >
> >> > We could also get fancier and have OS specific lookup like Python does
> >> > for OS X and Windows as a fallback:
> >> >
> >> > https://docs.python.org/2/library/urllib.html#urllib.getproxies
> >> >
> >> >
> >> > On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper 
> >> > wrote:
> >> >>
> >> >> Hi list,
> >> >> I'm planning to add http proxy support to http.client. Here's the API
> >> >> I thought of, please feel free to give some feedback :)
> >> >>
> >> >> - add a "proxy" slot to the request object. (Or maybe subclass
> request
> >> >> as client-request and only add that slot to client ? I think that
> >> >> would be better for maintenance, but it's a bigger change. What do
> you
> >> >> think ?)
> >> >>
> >> >> - use string global variables (*not* SYMBOL:, so that one can set it
> >> >> from the command line) or set the request slot directly so that one
> >> >> can do:
> >> >> ./factor -http.proxy=http://localhost:3128
> >> >> or "http://localhost:3128"; "http.proxy" set-global
> >> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ]
> with-variable
> >> >> or  ... URL" http://localhost:3128"; >>proxy
> >> >>
> >> >> - the "http.proxy", "https.proxy" and "no_proxy" variables are used
> to
> >> >> fill the proxy slot of the request when using   (so
> >> >> http-get, etc all have it)
> >> >>
> >> >> - use the "http_proxy" "https_proxy" "no_proxy" environnement
> variable
> >> >> as a last resort. I don't know about windows and macosx ?
> >> >>
> >> >> As far as the code for *http* (not https) access goes, I think the
> >> >> following patch is all that there is to do (it's missing checking the
> >> >> non proxy host list, and setting the http or https proxy depending on
> >> >> the url) ? http://paste.factorcode.org/paste?id=3826
> >> >>
> >> >> For https, I need to do an HTTP connect first, then send regular http
> >> >> request I think. Will try that later.
> >> >>
> >> >> Cheers,
> >> >> Jon
> >> >>
> >> >>
> >> >>
> --
> >> >> Site24x7 APM Insight: Get Deep Visibility into Application
> Performance
> >> >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >> >> Monitor end-to-end web transactions and take corrective actions now
> >> >> Troubleshoot faster and improve end-user experience. Signup Now!
> >> >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >> >> ___
> >> >> Factor-talk mailing list
> >> >> Factor-talk@lists.sourceforge.net
> >> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >> >
> >> >
> >> >
> >> >
> >> >
> --
> >> >

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread Jon Harper
I don't really know, but
http://stackoverflow.com/questions/15460819/what-is-the-difference-between-connection-and-proxy-connection-in-http-header
says that "Connection" and "Proxy-Connection" are the same, and factor
sends "Connection: close", curl send "Proxy-Connection: Keep-Alive"
and wget sends nothing.. That's why I wanted to know if someone who
know HTTP well had comments... Also the port in the "Host" header is
omitted by factor but set by wget and curl
Jon


On Fri, Feb 5, 2016 at 4:58 PM, John Benediktsson  wrote:
> Looks like curl sends a Proxy-Connection, which since you know you're using
> a proxy you could set in the request?
>
> On Fri, Feb 5, 2016 at 7:32 AM, Jon Harper  wrote:
>>
>> I had environnement variables in mind as well but forgot to show them in
>> the examples. So the full list would be:
>>
>> ! at factor startup
>> ./factor -http.proxy=http://localhost:3128
>> or http_proxy="http://localhost:3128"; ./factor
>>
>> ! using variables
>> or "http://localhost:3128"; "http.proxy" set-global
>> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
>>
>> ! Manually making the request
>> or  ... URL" http://localhost:3128"; >>proxy
>>
>>
>>
>> I also looked into https, it worked with send-secure-handshake
>> (http://docs.factorcode.org/content/article-ssl-upgrade.html ), here's a
>> proof of concept patch: http://paste.factorcode.org/paste?id=3826#1645
>> However, looking at the http headers, they are different than what wget or
>> curl sends, so I'm not sure if it's correct yet (it worked with squid as the
>> proxy and https//www.google.fr/ as the server). Can anyone comment on
>> whether everything's ok ?
>>
>>
>>
>> Le 4 févr. 2016 18:01, "John Benediktsson"  a écrit :
>> >
>> > It might be nicer to use environment variables rather than python string
>> > global variables, for example how Python does it:
>> >
>> > $ http_proxy=http://10.0.0.1 python -c "import urllib; print
>> > urllib.getproxies()"
>> > {'http': 'http://10.0.0.1'}
>> >
>> > We could also get fancier and have OS specific lookup like Python does
>> > for OS X and Windows as a fallback:
>> >
>> > https://docs.python.org/2/library/urllib.html#urllib.getproxies
>> >
>> >
>> > On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper 
>> > wrote:
>> >>
>> >> Hi list,
>> >> I'm planning to add http proxy support to http.client. Here's the API
>> >> I thought of, please feel free to give some feedback :)
>> >>
>> >> - add a "proxy" slot to the request object. (Or maybe subclass request
>> >> as client-request and only add that slot to client ? I think that
>> >> would be better for maintenance, but it's a bigger change. What do you
>> >> think ?)
>> >>
>> >> - use string global variables (*not* SYMBOL:, so that one can set it
>> >> from the command line) or set the request slot directly so that one
>> >> can do:
>> >> ./factor -http.proxy=http://localhost:3128
>> >> or "http://localhost:3128"; "http.proxy" set-global
>> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
>> >> or  ... URL" http://localhost:3128"; >>proxy
>> >>
>> >> - the "http.proxy", "https.proxy" and "no_proxy" variables are used to
>> >> fill the proxy slot of the request when using   (so
>> >> http-get, etc all have it)
>> >>
>> >> - use the "http_proxy" "https_proxy" "no_proxy" environnement variable
>> >> as a last resort. I don't know about windows and macosx ?
>> >>
>> >> As far as the code for *http* (not https) access goes, I think the
>> >> following patch is all that there is to do (it's missing checking the
>> >> non proxy host list, and setting the http or https proxy depending on
>> >> the url) ? http://paste.factorcode.org/paste?id=3826
>> >>
>> >> For https, I need to do an HTTP connect first, then send regular http
>> >> request I think. Will try that later.
>> >>
>> >> Cheers,
>> >> Jon
>> >>
>> >>
>> >> --
>> >> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> >> Monitor end-to-end web transactions and take corrective actions now
>> >> Troubleshoot faster and improve end-user experience. Signup Now!
>> >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>> >> ___
>> >> Factor-talk mailing list
>> >> Factor-talk@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
>> >
>> >
>> >
>> >
>> > --
>> > Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> > Monitor end-to-end web transactions and take corrective actions now
>> > Troubleshoot faster and improve end-user experience. Signup Now!
>> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>> > _

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread John Benediktsson
Looks like curl sends a Proxy-Connection, which since you know you're using
a proxy you could set in the request?

On Fri, Feb 5, 2016 at 7:32 AM, Jon Harper  wrote:

> I had environnement variables in mind as well but forgot to show them in
> the examples. So the full list would be:
>
> ! at factor startup
> ./factor -http.proxy=http://localhost:3128
> or http_proxy="http://localhost:3128"; ./factor
>
> ! using variables
> or "http://localhost:3128"; "http.proxy" set-global
> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
>
> ! Manually making the request
> or  ... URL" http://localhost:3128"; >>proxy
>
>
>
> I also looked into https, it worked with send-secure-handshake (
> http://docs.factorcode.org/content/article-ssl-upgrade.html ), here's a
> proof of concept patch: http://paste.factorcode.org/paste?id=3826#1645
> However, looking at the http headers, they are different than what wget or
> curl sends, so I'm not sure if it's correct yet (it worked with squid as
> the proxy and https//www.google.fr/ as the server). Can anyone comment on
> whether everything's ok ?
>
>
>
> Le 4 févr. 2016 18:01, "John Benediktsson"  a écrit :
> >
> > It might be nicer to use environment variables rather than python string
> global variables, for example how Python does it:
> >
> > $ http_proxy=http://10.0.0.1 python -c "import urllib; print
> urllib.getproxies()"
> > {'http': 'http://10.0.0.1'}
> >
> > We could also get fancier and have OS specific lookup like Python does
> for OS X and Windows as a fallback:
> >
> > https://docs.python.org/2/library/urllib.html#urllib.getproxies
> >
> >
> > On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper 
> wrote:
> >>
> >> Hi list,
> >> I'm planning to add http proxy support to http.client. Here's the API
> >> I thought of, please feel free to give some feedback :)
> >>
> >> - add a "proxy" slot to the request object. (Or maybe subclass request
> >> as client-request and only add that slot to client ? I think that
> >> would be better for maintenance, but it's a bigger change. What do you
> >> think ?)
> >>
> >> - use string global variables (*not* SYMBOL:, so that one can set it
> >> from the command line) or set the request slot directly so that one
> >> can do:
> >> ./factor -http.proxy=http://localhost:3128
> >> or "http://localhost:3128"; "http.proxy" set-global
> >> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
> >> or  ... URL" http://localhost:3128"; >>proxy
> >>
> >> - the "http.proxy", "https.proxy" and "no_proxy" variables are used to
> >> fill the proxy slot of the request when using   (so
> >> http-get, etc all have it)
> >>
> >> - use the "http_proxy" "https_proxy" "no_proxy" environnement variable
> >> as a last resort. I don't know about windows and macosx ?
> >>
> >> As far as the code for *http* (not https) access goes, I think the
> >> following patch is all that there is to do (it's missing checking the
> >> non proxy host list, and setting the http or https proxy depending on
> >> the url) ? http://paste.factorcode.org/paste?id=3826
> >>
> >> For https, I need to do an HTTP connect first, then send regular http
> >> request I think. Will try that later.
> >>
> >> Cheers,
> >> Jon
> >>
> >>
> --
> >> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> >> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> >> Monitor end-to-end web transactions and take corrective actions now
> >> Troubleshoot faster and improve end-user experience. Signup Now!
> >> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> >> ___
> >> Factor-talk mailing list
> >> Factor-talk@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
> >
> >
> >
> --
> > Site24x7 APM Insight: Get Deep Visibility into Application Performance
> > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> > Monitor end-to-end web transactions and take corrective actions now
> > Troubleshoot faster and improve end-user experience. Signup Now!
> > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> > ___
> > Factor-talk mailing list
> > Factor-talk@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/factor-talk
> >
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> ___
> Factor-talk mailing

Re: [Factor-talk] adding http proxy support

2016-02-05 Thread Jon Harper
I had environnement variables in mind as well but forgot to show them in
the examples. So the full list would be:

! at factor startup
./factor -http.proxy=http://localhost:3128
or http_proxy="http://localhost:3128"; ./factor

! using variables
or "http://localhost:3128"; "http.proxy" set-global
or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable

! Manually making the request
or  ... URL" http://localhost:3128"; >>proxy



I also looked into https, it worked with send-secure-handshake (
http://docs.factorcode.org/content/article-ssl-upgrade.html ), here's a
proof of concept patch: http://paste.factorcode.org/paste?id=3826#1645
However, looking at the http headers, they are different than what wget or
curl sends, so I'm not sure if it's correct yet (it worked with squid as
the proxy and https//www.google.fr/ as the server). Can anyone comment on
whether everything's ok ?



Le 4 févr. 2016 18:01, "John Benediktsson"  a écrit :
>
> It might be nicer to use environment variables rather than python string
global variables, for example how Python does it:
>
> $ http_proxy=http://10.0.0.1 python -c "import urllib; print
urllib.getproxies()"
> {'http': 'http://10.0.0.1'}
>
> We could also get fancier and have OS specific lookup like Python does
for OS X and Windows as a fallback:
>
> https://docs.python.org/2/library/urllib.html#urllib.getproxies
>
>
> On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper  wrote:
>>
>> Hi list,
>> I'm planning to add http proxy support to http.client. Here's the API
>> I thought of, please feel free to give some feedback :)
>>
>> - add a "proxy" slot to the request object. (Or maybe subclass request
>> as client-request and only add that slot to client ? I think that
>> would be better for maintenance, but it's a bigger change. What do you
>> think ?)
>>
>> - use string global variables (*not* SYMBOL:, so that one can set it
>> from the command line) or set the request slot directly so that one
>> can do:
>> ./factor -http.proxy=http://localhost:3128
>> or "http://localhost:3128"; "http.proxy" set-global
>> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
>> or  ... URL" http://localhost:3128"; >>proxy
>>
>> - the "http.proxy", "https.proxy" and "no_proxy" variables are used to
>> fill the proxy slot of the request when using   (so
>> http-get, etc all have it)
>>
>> - use the "http_proxy" "https_proxy" "no_proxy" environnement variable
>> as a last resort. I don't know about windows and macosx ?
>>
>> As far as the code for *http* (not https) access goes, I think the
>> following patch is all that there is to do (it's missing checking the
>> non proxy host list, and setting the http or https proxy depending on
>> the url) ? http://paste.factorcode.org/paste?id=3826
>>
>> For https, I need to do an HTTP connect first, then send regular http
>> request I think. Will try that later.
>>
>> Cheers,
>> Jon
>>
>>
--
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
>
>
--
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] adding http proxy support

2016-02-04 Thread John Benediktsson
It might be nicer to use environment variables rather than python string
global variables, for example how Python does it:

$ http_proxy=http://10.0.0.1 python -c "import urllib; print
urllib.getproxies()"
{'http': 'http://10.0.0.1'}

We could also get fancier and have OS specific lookup like Python does for
OS X and Windows as a fallback:

https://docs.python.org/2/library/urllib.html#urllib.getproxies


On Thu, Feb 4, 2016 at 8:48 AM, Jon Harper  wrote:

> Hi list,
> I'm planning to add http proxy support to http.client. Here's the API
> I thought of, please feel free to give some feedback :)
>
> - add a "proxy" slot to the request object. (Or maybe subclass request
> as client-request and only add that slot to client ? I think that
> would be better for maintenance, but it's a bigger change. What do you
> think ?)
>
> - use string global variables (*not* SYMBOL:, so that one can set it
> from the command line) or set the request slot directly so that one
> can do:
> ./factor -http.proxy=http://localhost:3128
> or "http://localhost:3128"; "http.proxy" set-global
> or "http://localhost:3128"; "http.proxy" [ ... http-get ] with-variable
> or  ... URL" http://localhost:3128"; >>proxy
>
> - the "http.proxy", "https.proxy" and "no_proxy" variables are used to
> fill the proxy slot of the request when using   (so
> http-get, etc all have it)
>
> - use the "http_proxy" "https_proxy" "no_proxy" environnement variable
> as a last resort. I don't know about windows and macosx ?
>
> As far as the code for *http* (not https) access goes, I think the
> following patch is all that there is to do (it's missing checking the
> non proxy host list, and setting the http or https proxy depending on
> the url) ? http://paste.factorcode.org/paste?id=3826
>
> For https, I need to do an HTTP connect first, then send regular http
> request I think. Will try that later.
>
> Cheers,
> Jon
>
>
> --
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
--
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk