Re: gethostbyname - how to use with a proxy name?
- From: "Ali" <abdulrazaq@xxxxxxxxx>
- Date: 1 Feb 2007 11:23:09 -0800
On Feb 1, 9:28 am, "Alexander Nickolov" <agnicko...@xxxxxxxx> wrote:
You are making your life harder than it needs to be. You
only need to record the local port number for the proxy
connection and check it against new packets. Obviously
you'll need to track a set of connections, but that's hardly
news for you...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnicko...@xxxxxxxx
MVP VC FAQ:http://vcfaq.mvps.org
=====================================
"fdryan" <fdr...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3859ECE5-3A60-42E4-B5E3-5334E0B89D86@xxxxxxxxxxxxxxxx
Approaching this problem from a different direction I tried a
gethostbyaddr()
to get the host name when I had the destination IP. gethostbyaddr() works
great with "ordinary" domain names however with a proxy URL name I get a
WSAGetLastError (11004) "Valid name, no data record of requested type" so
no
luck here either. The proxy URL name is verified good.
"fdryan" wrote:
Thank you Alex, I should explain what my underlying goal here is - I am
launching a new browser with a proxy name - In parallel I am sniffing the
IPaddresses in the TCP packets to track the packets to determine download
progress, initially I simply verify the SYN packet is sent out to the
proxy
host. However there is lots of Packet activity in the LAN so I need to
verify that the host and IPaddresses match. That is why I use
gethostbyname() to get the IP address(s) so I can compare them later.
"Alexander Nickolov" wrote:
I assume it doesn't break because you have a proxy, but
because your internal DNS server is limited to internal
addresses on purpose. In that case you don't need to resolve
the name at all - pass it directly to the proxy. The proxy
server will resolve the name for you. Even if you could
resolve the name what good is it for you - you can't connect
to that address due to your network topology...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnicko...@xxxxxxxx
MVP VC FAQ:http://vcfaq.mvps.org
=====================================
"fdryan" <fdr...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2EA29A29-D0AD-4A59-9F5C-C291A715F7CF@xxxxxxxxxxxxxxxx
Using winsock2.h I can use gethostbyname() to get the IP address with
no
trouble with ordinary names such as "www.msn.com" but it breaks with
a
proxy
name -
char hostname[] = "www.msn.com";
struct hostent *phe = gethostbyname(hostname);
How do I get gethostbyname to work with a proxy?
Snip:
You only need to record the local port number for the proxy connection and check it against new packets.
Never read RFC for TCP/IP, do you mean that port will be reserved for
that specific ip even time-out?
ali
.
- References:
- Re: gethostbyname - how to use with a proxy name?
- From: Alexander Nickolov
- Re: gethostbyname - how to use with a proxy name?
- Prev by Date: Re: gethostbyname - how to use with a proxy name?
- Next by Date: Re: Winsock2 SO_SNDBUF / UDP message send process
- Previous by thread: Re: gethostbyname - how to use with a proxy name?
- Next by thread: Re: gethostbyname - how to use with a proxy name?
- Index(es):
Relevant Pages
|