server.go
is a simple http server that reads the entire request body and returns it to the client.client.go
tries to send a http request with a chunked request body containing two bytes "ab". The request is send in two tcp frames.
-
Install go ( https://golang.org ). We tested with 1.6 but older versions should work.
-
Start the server in one terminal ( 127.0.0.1:8080 is the address to bind on ):
go run server.go 127.0.0.1:8080
-
Start the client in another terminal ( 127.0.0.1:8080 is the address to connect to ):
go run client.go 127.0.0.1:8080
client.go
:
go run client.go 127.0.0.1:8080
Received code:200 body:"ab"
Received code:200 body:"ab"
Received code:200 body:"ab"
Received code:200 body:"ab"
...
server.go
:
Received body:"ab"
Received body:"ab"
Received body:"ab"
...