FAQ
I want to create a http proxy server in go that will receive a request and
send the request to another server with all the headers and then return the
response it receives to the caller. Can some one let me know how this can
be done efficiently?

--
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

  • Giulio Iotti at Sep 18, 2015 at 12:08 pm

    On Friday, September 18, 2015 at 1:51:03 PM UTC+2, DM wrote:
    I want to create a http proxy server in go that will receive a request and
    send the request to another server with all the headers and then return the
    response it receives to the caller. Can some one let me know how this can
    be done efficiently?
    That's a reverse proxy, please google for recipes on how to make one.

    My take was
    this: https://github.com/dullgiulio/go-tests/blob/master/rproxy/main.go

    --
    Giulio Iotti

    --
    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 18, 2015 at 4:19 pm
    This is actually included with Go already:
    http://golang.org/pkg/net/http/httputil/#ReverseProxy

    On Fri, Sep 18, 2015 at 4:51 AM, DM wrote:

    I want to create a http proxy server in go that will receive a request and
    send the request to another server with all the headers and then return the
    response it receives to the caller. Can some one let me know how this can
    be done efficiently?

    --
    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.
  • Guillaume J. Charmes at Sep 18, 2015 at 5:23 pm
    Or if you want I created a small utils to extend the reverse proxy from the
    stdlib: https://github.com/creack/goproxy

    --

    Guillaume J. Charmes
    about.me/guillaumecharmes
    [image: Guillaume J. Charmes on about.me]
       <http://about.me/guillaumecharmes>
    On Fri, Sep 18, 2015 at 11:19 AM, Brad Fitzpatrick wrote:

    This is actually included with Go already:
    http://golang.org/pkg/net/http/httputil/#ReverseProxy

    On Fri, Sep 18, 2015 at 4:51 AM, DM wrote:

    I want to create a http proxy server in go that will receive a request
    and send the request to another server with all the headers and then return
    the response it receives to the caller. Can some one let me know how this
    can be done efficiently?

    --
    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.
    --
    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.
  • Debraj Manna at Sep 20, 2015 at 1:28 pm
    Thanks :)
    On Sep 18, 2015 10:53 PM, "Guillaume J. Charmes" wrote:

    Or if you want I created a small utils to extend the reverse proxy from
    the stdlib: https://github.com/creack/goproxy

    --

    Guillaume J. Charmes
    about.me/guillaumecharmes
    [image: Guillaume J. Charmes on about.me]
    <http://about.me/guillaumecharmes>
    On Fri, Sep 18, 2015 at 11:19 AM, Brad Fitzpatrick wrote:

    This is actually included with Go already:
    http://golang.org/pkg/net/http/httputil/#ReverseProxy

    On Fri, Sep 18, 2015 at 4:51 AM, DM wrote:

    I want to create a http proxy server in go that will receive a request
    and send the request to another server with all the headers and then return
    the response it receives to the caller. Can some one let me know how this
    can be done efficiently?

    --
    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.
    --
    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.
  • Nathan Fisher at Sep 20, 2015 at 5:00 pm
    Hello,

    I implemented a configurable HTTPS proxy for local development of multiple
    web-services and a single static site. The built-in libraries make it
    really easy if you're already familiar with the HTTP server module. The
    only thing to be aware of with the proxy is that it forwards the external
    hostname. If you're proxy is found at "yolo.appspot.com" and the proxy URL
    is specified as "junctionbox.ca:80" it'll use the IP resolved for "
    junctionbox.ca" and the HOST header will be "yolo.appspot.com".

    https://github.com/nfisher/simplehttps/blob/master/main.go#L122

    Kind Regards,
    Nathan
    On Fri, 18 Sep 2015 at 12:51 DM wrote:

    I want to create a http proxy server in go that will receive a request and
    send the request to another server with all the headers and then return the
    response it receives to the caller. Can some one let me know how this can
    be done efficiently?

    --
    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 18, '15 at 11:51a
activeSep 20, '15 at 5:00p
posts6
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase