Re: gethostbyname - how to use with a proxy name?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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

.



Relevant Pages

  • Re: gethostbyname - how to use with a proxy name?
    ... A TCP connection is identified by ... Microsoft MVP, MCSD ... great with "ordinary" domain names however with a proxy URL name I get ... IPaddresses in the TCP packets to track the packets to determine ...
    (microsoft.public.win32.programmer.networks)
  • Re: Update: UDP 770 Potential Worm
    ... > the network immediately after the 'attack', ... were no packets indicating some form of replication. ... I noticed that the UDP ... > of the UDP datagrams is the IP address of the proxy? ...
    (Incidents)
  • Re: Update: UDP 770 Potential Worm
    ... > were no packets indicating some form of replication. ... > my capture was limited due to the switched ... to see if the problem occurs on the test network, ... The proxy had already been isolated from the ...
    (Incidents)
  • Re: [fw-wiz] dirty packet tricks?
    ... solve via promiscuously sucking up packets. ... restriction that your 'sideways' proxy box is it will have to be on a hub ... The firewall will have to suppress all ICMP errors to the internal network ...
    (Firewall-Wizards)
  • a problem with nat table setting
    ... linux PC and the webserver before I start the proxy, ... http packet will not be passed to the proxy, ... Chain INPUT (policy ACCEPT 3574 packets, ...
    (comp.os.linux.misc)