By definition, HTTP pipelining is a technique in which multiple HTTP requests are sent on a single TCP connection without waiting for the corresponding responses, according to Wikipedia, and some other resources. What is meant by TCP connection, is it the connection that starts when the client and server first communicate doing the 3 way handshake? Is it the same TCP stream? TCP stream meaning that the client and server communicate with each other using the same combination of ports.
Related
AFAIK, HTTP proxy CONNECT HTTP/1.1 requests tunnel a single TCP connection. After any TCP connection is closed, both upstream and downstream connections are closed. Connection reuse isn't possible. Is it possible to make HTTP/2 requests to a proxy to mux multiple tunneled over a single TCP (upstream) connection to avoid the cost of TCP handshake? Does the HTTP/2 standard allow the CONNECT method?
Yes, in HTTP/2 the CONNECT method exists too:
"In HTTP/2, the CONNECT method is used to establish a tunnel over a single HTTP/2 stream to a remote host for similar purposes"
Im trying to write a server client program, where client sends request through UDP socket to a server, then server responds back to a client through TCP socket.
My question is, how can server establish a TCP connection back to a client after getting the request through UDP?
I'll add code parts on Monday, but I more interested in pseudocode for that. Does that mean that the client should listen on tcp port after sending udp request? So confused
I am wondering if there is easy way to reverse the http client/server tcp connection direction with golang.
I would like http client behavior on tcp listen port, and http server on tcp dial out .
Is there a way init/create http client or server based on already established net.conn and using them?
thanks.
I don't fully understand when a TCP connection ends. That is, when a client sends a request to a server and the server responds, is that response part of the same TCP connection? Or is that response made through a brand new TCP connection?
A TCP connection ends when both sides have closed it. A response is sent over the same connection as the request, and there can be many request/response pairs over a single connection. Or none, just a download for example.
when a TCP client wants to establish a tcp connection with a tcp server
it needs to send SYN and then ACK
while tcp server only sends SYN/ACK
so they are different
but , after the 3_way handshaking,
is this connection symmetric, namely, are TCP client and server in equal status
for example, after the 3-way handshake, usually the client send packet first,
can TCP server send packet first?
No, the procedure is not different at all, but instead of sending a SYN then an ACK in two different packets, the servers concatenate them by sending them via a single packet!
In the other hand, remember always that the client/server nomenclature is relative. The server is the party that remains in listening mode, while the client is the party that initiates the connection ...
After the establishment of the connection, both parties are equivalent (same status as you said: ESTABLISHED). For that reason, both can send the FIN statement to close the connection ...
After the connection is established, both ends are indeed "symmetric". Who sends first is decided by the underlying protocol and differes amongst them.
For example, HTTP starts with the GET <path> HTTP/1.0 command, while other protocols let the server give a greeting line first, and only then the client sends its request.
So in general, both ends are free to send their stuff first.