FAQ
Hello,

I wrote a really simple server :

-----------------------------------------------------------------------------------------------------
package main

import (
   "fmt"
   "net/http"
)

func main() {
   http.HandleFunc("/", root)

   fmt.Println("listening on port: 7777")
err := http.ListenAndServe(":7777", nil)
if err != nil {
   panic(err)
}
}

func root(res http.ResponseWriter, req *http.Request) {
fmt.Fprintf(res, "Hello")
}
-----------------------------------------------------------------------------------------------------------------------------

When I do "curl localhost:7777/" I see "hello" printed in the response so
all is ok. But when I play the same request using netcat:

------------------------------------------------------------------------------------------------------------------------------
$> nc localhost 7777
GET / HTTP/1.1 #writing the request
manually
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0
OpenSSL/0.9.8y zlib/1.2.5
Host: localhost:7777
Accept: */*

HTTP/1.1 200 OK #response headers
Content-Type: text/plain; charset=utf-8
Content-Length: 5
Date: Sun, 13 Oct 2013 18:42:55 GMT

Hello #here the
connection stays open just after "Hello", when I type return
HTTP/1.1 400 Bad Request # I see this and the
connection really close

------------------------------------------------------------------------------------------------------------------------------

What's happening here ? There is obviously something wrong but I can't tell
what.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ea81d3d2-64ef-47ff-af73-ce66d7fbc3c8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Minux at Oct 13, 2013 at 6:58 pm

    On Sun, Oct 13, 2013 at 2:53 PM, RobM wrote:

    Hello,

    I wrote a really simple server :


    -----------------------------------------------------------------------------------------------------
    package main

    import (
    "fmt"
    "net/http"
    )

    func main() {
    http.HandleFunc("/", root)

    fmt.Println("listening on port: 7777")
    err := http.ListenAndServe(":7777", nil)
    if err != nil {
    panic(err)
    }
    }

    func root(res http.ResponseWriter, req *http.Request) {
    fmt.Fprintf(res, "Hello")
    }

    -----------------------------------------------------------------------------------------------------------------------------

    When I do "curl localhost:7777/" I see "hello" printed in the response so
    all is ok. But when I play the same request using netcat:


    ------------------------------------------------------------------------------------------------------------------------------
    $> nc localhost 7777
    GET / HTTP/1.1 #writing the request
    manually
    User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0
    OpenSSL/0.9.8y zlib/1.2.5
    Host: localhost:7777
    Accept: */*

    HTTP/1.1 200 OK #response headers
    Content-Type: text/plain; charset=utf-8
    Content-Length: 5
    Date: Sun, 13 Oct 2013 18:42:55 GMT

    Hello #here the
    connection stays open just after "Hello", when I type return
    the problem is that you typed return here.

    your root handler doesn't output a \n, so you typed a \n, however, the HTTP
    server is
    treating that empty line you just typed as a new request line, and then it
    says bad request
    as the request line is empty.
    HTTP/1.1 400 Bad Request # I see this and the
    connection really close
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CA%2Bdb%3Dn0c2_PsSp5PWVaURo4mSZWaABfoA9Ngh9vKH09Ydf6Lxg%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 13, 2013 at 7:03 pm
    Ok thanks got it but even if I change "Hello" to "Hello\n" the connection
    stays opened ... Shouldn't it be closed once the handler returns ?

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2f3fe522-80ce-4528-889e-aced81b7c443%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at Oct 13, 2013 at 7:12 pm

    On Sun, Oct 13, 2013 at 3:03 PM, RobM wrote:

    Ok thanks got it but even if I change "Hello" to "Hello\n" the connection
    stays opened ... Shouldn't it be closed once the handler returns ?
    by default, the net/http tries to wait some time before closing the
    connection (http 1.1 keepalive),
    so the the client don't need to open a new connection for each resource and
    can reuse the current
    connection.

    you can get the behavior you want by sending this:
    GET / HTTP/1.0

    or this:
    GET / HTTP/1.1
    Host: localhost
    Connection: close

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CA%2Bdb%3Dn3daXSQuajt5gCLY7d8%2BjfeX0W37UW67MCcngbMwdwLUQ%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 13, 2013 at 7:24 pm
    Thank you for your answer. I thought this was the reason why I couldn't get
    HTTP trailer working but it seems that it's not. Here is what I do at the
    end of my handler
    ----------------------------------------------------
    trailers := map[string]string {
         "x-my-trailer": "here it is",
    }
    m := make(http.Header)
    for k, v := range(trailers) {
        m.Add(k, v)
    }
    req.Trailer = m
    ----------------------------------------------------
    I should see the trailer using netcat (did it before in node.js) but I
    don't. Any idea where is my mistake ?

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b44dffc6-efb4-4891-967e-555a02cd4352%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Benjamin Measures at Oct 14, 2013 at 10:21 am
    I couldn't get HTTP trailer working but it seems that it's not. Here is what I do at the end of my handler
    Make sure you're checking for errs:
    http://golang.org/pkg/net/http/#pkg-variables
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without chunked transfer encoding"}
    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show your code).

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/1d4084e4-e805-4108-9895-29d8be48d676%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 14, 2013 at 4:16 pm
    Here is the code I use in a handler to send HTTP trailers when the request
    ends:
    ----------------------------------------------------
    res.Header().Add("Trailer", "x-my-trailer") #warning the client that
    trailer is expected

    //doint stuff here

    trailers := map[string]string {
         "x-my-trailer": "here it is",
    }
    m := make(http.Header) #creating a trailer (of
    type http.Header)
    for k, v := range(trailers) {
        m.Add(k, v)
    }
    req.Trailer = m #setting the
    trailer
    ----------------------------------------------------

    As I said before, I should see trailer at the end of my request using
    netcat (after the 0 sized chunk). I'm using HTTP 1.1 as well as chunked
    encoding.
    Any idea ? I read that HTTP trailers are not yet fully supported in Go
    On Monday, 14 October 2013 12:21:41 UTC+2, Benjamin Measures wrote:

    I couldn't get HTTP trailer working but it seems that it's not. Here is
    what I do at the end of my handler

    Make sure you're checking for errs:
    http://golang.org/pkg/net/http/#pkg-variables
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without chunked
    transfer encoding"}

    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show your
    code).
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6dcbfba9-445f-40d6-afc2-4de0ec78d7cd%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dave Cheney at Oct 14, 2013 at 6:07 pm
    I'm pretty sure I remember Brad saying that trailers are not supported. Does your client signal it is willing to accept trailers with the TE header?


    On 15 Oct 2013, at 3:16, RobM wrote:

    Here is the code I use in a handler to send HTTP trailers when the request ends:
    ----------------------------------------------------
    res.Header().Add("Trailer", "x-my-trailer") #warning the client that trailer is expected

    //doint stuff here

    trailers := map[string]string {
    "x-my-trailer": "here it is",
    }
    m := make(http.Header) #creating a trailer (of type http.Header)
    for k, v := range(trailers) {
    m.Add(k, v)
    }
    req.Trailer = m #setting the trailer
    ----------------------------------------------------

    As I said before, I should see trailer at the end of my request using netcat (after the 0 sized chunk). I'm using HTTP 1.1 as well as chunked encoding.
    Any idea ? I read that HTTP trailers are not yet fully supported in Go
    On Monday, 14 October 2013 12:21:41 UTC+2, Benjamin Measures wrote:
    I couldn't get HTTP trailer working but it seems that it's not. Here is what I do at the end of my handler
    Make sure you're checking for errs:
    http://golang.org/pkg/net/http/#pkg-variables
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without chunked transfer encoding"}
    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show your code).
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6dcbfba9-445f-40d6-afc2-4de0ec78d7cd%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/A49C36A6-5EDF-4830-85E1-430C1E463EDC%40cheney.net.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 14, 2013 at 7:36 pm
    Well, it's supposed to be "partially complete".
    From http://golang.org/src/pkg/net/http/request.go :

    // Trailer maps trailer keys to values. Like for Header, if the// response has multiple trailer lines with the same key, they will be// concatenated, delimited by commas.// For server requests, Trailer is only populated after Body has been// closed or fully consumed.// Trailer support is only partially complete.
    Trailer Header

    Client side request is ok, doing the same request on a nodejs server I get
    the trailers I expect. Trailer usage may not be possible yet ...
    On Monday, 14 October 2013 20:07:42 UTC+2, Dave Cheney wrote:

    I'm pretty sure I remember Brad saying that trailers are not supported.
    Does your client signal it is willing to accept trailers with the TE header?



    On 15 Oct 2013, at 3:16, RobM <robin...@gmail.com <javascript:>> wrote:

    Here is the code I use in a handler to send HTTP trailers when the request
    ends:
    ----------------------------------------------------
    res.Header().Add("Trailer", "x-my-trailer") #warning the client that
    trailer is expected

    //doint stuff here

    trailers := map[string]string {
    "x-my-trailer": "here it is",
    }
    m := make(http.Header) #creating a trailer
    (of type http.Header)
    for k, v := range(trailers) {
    m.Add(k, v)
    }
    req.Trailer = m #setting the
    trailer
    ----------------------------------------------------

    As I said before, I should see trailer at the end of my request using
    netcat (after the 0 sized chunk). I'm using HTTP 1.1 as well as chunked
    encoding.
    Any idea ? I read that HTTP trailers are not yet fully supported in Go
    On Monday, 14 October 2013 12:21:41 UTC+2, Benjamin Measures wrote:

    I couldn't get HTTP trailer working but it seems that it's not. Here is
    what I do at the end of my handler

    Make sure you're checking for errs:
    http://golang.org/pkg/net/http/#pkg-variables
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without
    chunked transfer encoding"}

    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show your
    code).

    --
    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...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/6dcbfba9-445f-40d6-afc2-4de0ec78d7cd%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/52824763-58c5-4078-ac2d-d897038bb500%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Benjamin Measures at Oct 14, 2013 at 10:13 pm

    On Monday, 14 October 2013 19:07:42 UTC+1, Dave Cheney wrote:

    I'm pretty sure I remember Brad saying that trailers are not supported.
    Oh yes:
    http://golang.org/src/pkg/net/http/server.go#L278
    // zero EOF chunk, trailer key/value pairs (currently
    // unsupported in Go's server), followed by a blank
    // line.
    (Beside not trying to modify request.Trailer) The OP will need to
    modify/implement their own http.server, possibly using httputil.ServerConn
    . Considering client support though (they can be silently dropped), it's
    hard to see how it's worth the effort.

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/52dff2a7-78fa-450b-b4e3-df4b60de1381%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Robin Monjo at Oct 15, 2013 at 9:46 am
    Ok thanks I won't use trailer then.

    On Oct 15, 2013, at 12:13 AM, Benjamin Measures wrote:

    On Monday, 14 October 2013 19:07:42 UTC+1, Dave Cheney wrote:
    I'm pretty sure I remember Brad saying that trailers are not supported.

    Oh yes:
    http://golang.org/src/pkg/net/http/server.go#L278
    // zero EOF chunk, trailer key/value pairs (currently
    // unsupported in Go's server), followed by a blank
    // line.
    (Beside not trying to modify request.Trailer) The OP will need to modify/implement their own http.server, possibly using httputil.ServerConn . Considering client support though (they can be silently dropped), it's hard to see how it's worth the effort.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/EFF35A8B-0F2B-4449-8CF6-2BC7A3635FCE%40gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Kyle Lemons at Oct 16, 2013 at 4:56 am
    ResponseWriter has no trailer support. You're trying to set the trailer on
    the incoming request, but that has no effect on the response sent to the
    client.

    On Mon, Oct 14, 2013 at 11:07 AM, Dave Cheney wrote:

    I'm pretty sure I remember Brad saying that trailers are not supported.
    Does your client signal it is willing to accept trailers with the TE header?



    On 15 Oct 2013, at 3:16, RobM wrote:

    Here is the code I use in a handler to send HTTP trailers when the request
    ends:
    ------------------------------**----------------------
    res.Header().Add("Trailer", "x-my-trailer") #warning the client that
    trailer is expected

    //doint stuff here

    trailers := map[string]string {
    "x-my-trailer": "here it is",
    }
    m := make(http.Header) #creating a trailer
    (of type http.Header)
    for k, v := range(trailers) {
    m.Add(k, v)
    }
    req.Trailer = m #setting the
    trailer
    ------------------------------**----------------------

    As I said before, I should see trailer at the end of my request using
    netcat (after the 0 sized chunk). I'm using HTTP 1.1 as well as chunked
    encoding.
    Any idea ? I read that HTTP trailers are not yet fully supported in Go
    On Monday, 14 October 2013 12:21:41 UTC+2, Benjamin Measures wrote:

    I couldn't get HTTP trailer working but it seems that it's not. Here is
    what I do at the end of my handler

    Make sure you're checking for errs:
    http://golang.org/pkg/net/**http/#pkg-variables<http://golang.org/pkg/net/http/#pkg-variables>
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without
    chunked transfer encoding"}

    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show your
    code).

    --
    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.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/6dcbfba9-445f-40d6-afc2-4de0ec78d7cd%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    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.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/A49C36A6-5EDF-4830-85E1-430C1E463EDC%40cheney.net
    .

    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABT7-ZOC%3DB%3D7AOx0MdB_ac-FXT1s1ZHQ%3DBHnkRy9_ym2GVp8bw%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 16, 2013 at 9:08 am
    Hum yes you're right, I got confused !
    On Wednesday, 16 October 2013 06:55:53 UTC+2, Kyle Lemons wrote:

    ResponseWriter has no trailer support. You're trying to set the trailer
    on the incoming request, but that has no effect on the response sent to the
    client.


    On Mon, Oct 14, 2013 at 11:07 AM, Dave Cheney <da...@cheney.net<javascript:>
    wrote:
    I'm pretty sure I remember Brad saying that trailers are not supported.
    Does your client signal it is willing to accept trailers with the TE header?



    On 15 Oct 2013, at 3:16, RobM <robin...@gmail.com <javascript:>> wrote:

    Here is the code I use in a handler to send HTTP trailers when the
    request ends:
    ------------------------------**----------------------
    res.Header().Add("Trailer", "x-my-trailer") #warning the client that
    trailer is expected

    //doint stuff here

    trailers := map[string]string {
    "x-my-trailer": "here it is",
    }
    m := make(http.Header) #creating a trailer
    (of type http.Header)
    for k, v := range(trailers) {
    m.Add(k, v)
    }
    req.Trailer = m #setting the
    trailer
    ------------------------------**----------------------

    As I said before, I should see trailer at the end of my request using
    netcat (after the 0 sized chunk). I'm using HTTP 1.1 as well as chunked
    encoding.
    Any idea ? I read that HTTP trailers are not yet fully supported in Go
    On Monday, 14 October 2013 12:21:41 UTC+2, Benjamin Measures wrote:

    I couldn't get HTTP trailer working but it seems that it's not. Here
    is what I do at the end of my handler

    Make sure you're checking for errs:
    http://golang.org/pkg/net/**http/#pkg-variables<http://golang.org/pkg/net/http/#pkg-variables>
    ErrUnexpectedTrailer = &ProtocolError{"trailer header without
    chunked transfer encoding"}

    You cannot use trailers unless HTTP/1.1 and chunked encoding.

    Apart from that suggestion, my magic ball came up with nothing (show
    your code).

    --
    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...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/6dcbfba9-445f-40d6-afc2-4de0ec78d7cd%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    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...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/A49C36A6-5EDF-4830-85E1-430C1E463EDC%40cheney.net
    .

    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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/groups/opt_out.
  • Dave Cheney at Oct 13, 2013 at 10:55 pm
    If you want the remote server to close the connection it's response you need to ask it to do so. Two ways to do this are, using HTTP/1.0 or sending a Connection: close header with HTTP/1.1.
    On 14 Oct 2013, at 6:03, RobM wrote:

    Ok thanks got it but even if I change "Hello" to "Hello\n" the connection stays opened ... Shouldn't it be closed once the handler returns ?
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/2f3fe522-80ce-4528-889e-aced81b7c443%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/E2B1B533-68FE-4974-8753-40AD13AB11ED%40cheney.net.
    For more options, visit https://groups.google.com/groups/opt_out.
  • RobM at Oct 14, 2013 at 9:23 am
    Ok guys thanks for that I understand now. Any ideas about my HTTP trailer
    issue ?
    On Monday, 14 October 2013 00:55:09 UTC+2, Dave Cheney wrote:

    If you want the remote server to close the connection it's response you
    need to ask it to do so. Two ways to do this are, using HTTP/1.0 or sending
    a Connection: close header with HTTP/1.1.

    On 14 Oct 2013, at 6:03, RobM <robin...@gmail.com <javascript:>> wrote:

    Ok thanks got it but even if I change "Hello" to "Hello\n" the connection
    stays opened ... Shouldn't it be closed once the handler returns ?

    --
    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...@googlegroups.com <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/golang-nuts/2f3fe522-80ce-4528-889e-aced81b7c443%40googlegroups.com
    .
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/d4b8b0a4-c06c-4347-8ac1-b16bafaf9253%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dave Cheney at Oct 14, 2013 at 9:31 am

    Ok guys thanks for that I understand now. Any ideas about my HTTP trailer
    issue ?
    Can you please remind me what the trailer issue is ?

    --
    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.
    To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CANp9fE_XfgNL_cfKYc8ehjcvpLVjunyns0YqFYVZ%3DNxnc1%3Dh_g%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 13, '13 at 6:54p
activeOct 16, '13 at 9:08a
posts16
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase