FAQ
Hello,

As per the contribution guidelines [1], I wanted to try and measure the
reception of this proposal before starting work.

Go's default HTTP transport (`DefaultTransport`) respects the value of
the environment variable $http_proxy in order to instruct the underlying
connection layer that it should proxy connections through a given HTTP
server. Using this feature looks something like:

     HTTP_PROXY=http://proxy.example.com:8080 ./myapp

What I'd like to do is add support to $http_proxy for Unix domain
sockets alongside its current support for more common TCP connections.
The precise syntax would be up for debate, but I'd expect it to look
something like the following:

     HTTP_PROXY=http:///tmp/proxy.sock ./myapp
     HTTP_PROXY=/tmp/proxy ./myapp

(The latter using libpq's style [2] of assuming that a value beginning
with a slash is a Unix domain socket.)

In terms of design, I expect that the bulk of the changes would be in
Transport's dialConn method located in `src/pkg/net/http/transport.go`,
with a few other changes to that file as well.

Any thoughts on this? Once again, I'm happy to take a shot at the patch
if it looks even remotely interesting.

Thanks!
Brandur

[1] https://golang.org/doc/contribute.html
[2] http://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Ian Lance Taylor at Sep 19, 2014 at 1:12 pm

    On Thu, Sep 18, 2014 at 10:08 PM, Brandur wrote:
    Go's default HTTP transport (`DefaultTransport`) respects the value of
    the environment variable $http_proxy in order to instruct the underlying
    connection layer that it should proxy connections through a given HTTP
    server. Using this feature looks something like:

    HTTP_PROXY=http://proxy.example.com:8080 ./myapp

    What I'd like to do is add support to $http_proxy for Unix domain
    sockets alongside its current support for more common TCP connections.
    The precise syntax would be up for debate, but I'd expect it to look
    something like the following:

    HTTP_PROXY=http:///tmp/proxy.sock ./myapp
    HTTP_PROXY=/tmp/proxy ./myapp

    (The latter using libpq's style [2] of assuming that a value beginning
    with a slash is a Unix domain socket.)
    My first thought is that the HTTP_PROXY environment variable is used
    by a lot of different programs. This is an area where we should
    follow other people's lead. Are there other programs that use
    HTTP_PROXY in this way?

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Brad Fitzpatrick at Sep 19, 2014 at 3:21 pm
    I think this is too specific for HTTP_PROXY.

    It's easy enough to implement this yourself. It doesn't need to be
    available to all Go programs by default.

    On Fri, Sep 19, 2014 at 1:08 AM, Brandur wrote:

    Hello,

    As per the contribution guidelines [1], I wanted to try and measure the
    reception of this proposal before starting work.

    Go's default HTTP transport (`DefaultTransport`) respects the value of
    the environment variable $http_proxy in order to instruct the underlying
    connection layer that it should proxy connections through a given HTTP
    server. Using this feature looks something like:

    HTTP_PROXY=http://proxy.example.com:8080 ./myapp

    What I'd like to do is add support to $http_proxy for Unix domain
    sockets alongside its current support for more common TCP connections.
    The precise syntax would be up for debate, but I'd expect it to look
    something like the following:

    HTTP_PROXY=http:///tmp/proxy.sock ./myapp
    HTTP_PROXY=/tmp/proxy ./myapp

    (The latter using libpq's style [2] of assuming that a value beginning
    with a slash is a Unix domain socket.)

    In terms of design, I expect that the bulk of the changes would be in
    Transport's dialConn method located in `src/pkg/net/http/transport.go`,
    with a few other changes to that file as well.

    Any thoughts on this? Once again, I'm happy to take a shot at the patch
    if it looks even remotely interesting.

    Thanks!
    Brandur

    [1] https://golang.org/doc/contribute.html
    [2] http://godoc.org/github.com/lib/pq#hdr-Connection_String_Parameters

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 19, '14 at 5:08a
activeSep 19, '14 at 3:21p
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase