HTML server VB.net capturing IP-less browser input

Viewed 39

I have a simpel html server using a TCP protocal

If I type an adres in the browsers address-bar as an IP-address (example 192.168.0.1) and even trailing with a file name found on the local hard drive such as 192.168.0.1/Index.html it works perfectly (well atleast as I need it to work).

Now comes the qestion. The IP-addresses just look un-profesional so I'm attempting to create a basic DNS-server but if I type in my browsers address-bar anything void of an IP-address the HTTP header replies with GET/wpad.dat/HTTP/1.1 ?

The DNS server I'm making would get a basic text then look it up in a datagridview control column and respond with the actual address from a coresponding column (most likely the one next to it). I set-ip the initial test in a simple client server-chat program which works fine but I didn't anticipate an address-bar would repond diffrently.

The code snippet used to capture the reponse on the server side is as follows:

        Dim MyNetworkStream As NetworkStream = MyClient.GetStream()

        Dim MyReceivingBytes(100000) As Byte
        MyNetworkStream.Read(MyReceivingBytes, 0, MyReceivingBytes.Length)

        Dim MyIncommingRequests As String = Encoding.ASCII.GetString(MyReceivingBytes)

        MsgBox("hello " & MyIncommingRequests.Replace(vbNullChar, ""))

screenshot

0 Answers
Related