hey,

I'm trying to mimic the process of a proxy.
I setup a socket for the listening server first, do a bind and then listen, and
on the while loop I do accept, after the accept I setup another socket and set the client sockaddr_in struct with sin_addr.s_addr being the http server that this app will connect
to and sin_port being the http server port (80) and then I do a connect.

what happens is that the app is listening on some port, say 1000, when connected to, it's suppose to connect itself to another http server on port 80 but instead it connects to that remote server with source address 1000 and some random destination port (instead of being the opposite). I've double checked that I didn't mix the server and client's structs for sockaddr_in.

what can this be?