I am confused about how packets from my machine reaches their destination through proxy servers. my machine has a private ip for intranet and we have a proxy server with public ip to talk to world.
so we have three addresses here.
1) my private ip address
2) proxy server address
3) destination address (google.com)
now in the tcp packet that I send I have source and destination port to distinguish the various programs (like mozilla , chrome , ie) on my machine and destinations.
in the ip network layer I have source and destination address.
I don't know whether http also has addresses.
so when my packet leaves my machine, what address would it be containing. so that it reaches my proxy server through gateways in between. ?
once it reaches proxy server, NAT can be used to send it to destination. but I am confused about how it reaches proxy server.
EDIT: should my packet contain address of my proxy server (local private one) to reach it? I can change my proxy server by configuring my browser. how does my packet once it leaves my machine knows which proxy server it would go?