Tin Tran
Tin Tran

Reputation: 6202

If an IP is not listening on HTTP (isn't a server) or is offline, does the GET request parameters still get sent over the wire to them?

Let's say I know of an IP for example 1.2.3.4

and 1.2.3.4 isn't a webserver (so not listening for http requests) or 1.2.3.4 might be offline (powerouttage).

If in my browser, I typed: http://1.2.3.4?message=Love&subject=You and then I hit enter.

Does/Do the parameter(s) in this example message and subject still get sent over the wires and try it reach the IP 1.2.3.4? Of course I won't get a response but I only want to know if it's still sent over wires.

I tried using some packet viewer on chrome and it shows the GET request going out with parameters..but I want to know if the request with parameters actually gets to travel over the wire and make the usual hops to reach the IP (even though it is dropped once it reaches the IP because IP isn't listening).

Upvotes: 0

Views: 207

Answers (2)

freakish
freakish

Reputation: 56557

A typical browser will send entire URI over the wire, that's how HTTP is supposed to work. Regardless of whether the destination is a webserver or not (there's no way to know that a priori anyway). However the server should at least accept TCP connections for the consecutive write to happen. Meaning that if the server is offline then the connection won't be established and so no further network activity will happen.

Note that by "server" here I don't mean the final server in the proxy chain, but the one closest to you, the client. And so in the following chain: browser -> Proxy1 -> WebServer, your data will go over the network as long as Proxy1 is up, regardless of the state of the WebServer.

Whether the entire request goes through every potential intermediate machine and in an unmodified state fully depends on those machines and it is impossible to know that. But a typical proxy will try to pass the request unchanged or maybe slightly modified (it may add some headers but URI is typically left as it is).

That's why responses are so important. The only case when you can be sure that your request reached the destination is when the destination sends back a response that reaches you. It is analogous to classical mailing. You write a letter and pass it to a post office. There's no way for you to know whether the letter reaches the destination or not. Actually there's no way to know where it is at a given moment. Unless your recipient sends you back a response.

Upvotes: 0

deceze
deceze

Reputation: 522523

The request would go over a TCP connection, which must first be established via 3-way handshake. If the remote server is offline and does not respond to the first SYN TCP handshake request, then that should be that and nothing else should be sent.

If of course you still have an active TCP connection to the server from a previous request, then that handshake doesn't need to be repeated and your computer will assume the previously negotiated connection is still good, and directly send the HTTP request over the wire. It'll only notice that the connection has dropped when it doesn't get a reply to that request after a while.

You can of course get into more complex territory if any proxies or gateways are involved which may try to handle the request as middleman, in which case the request may go to one of those, but won't reach the final destination.

Upvotes: 1

Related Questions