darkforcesjedi Posted June 12, 2003 Posted June 12, 2003 Ok...here's what I'm trying to do... I'm trying to write a SOCKS4-type proxy with a console interface to display status information. (e.g. I would type connections at the prompt and get a list of connected clients). I've never written a network application before, but the logic seems simple enough. I found some sample code that listens for a TCP connection. The first packet I get from the client is to negotiate a connection. I get the target IP address and port number from the client. I don't know what to do next. I presume I need to open a connection with the server. I tried this (I used reverse DNS to get the hostname from the IP address, which is probably bad because some reverse DNS lookups will probably fail): 'this always times out target = New System.Net.Sockets.TcpClient(EndHost, EndPort) I searched google and planet source code supposedly has a sample proxy server in VB.NET, but I can't get to the site. Quote
archer_coal Posted June 13, 2003 Posted June 13, 2003 re networking I found a nice NETSTAT example for networking in VB.NET that may shed some light on the subject for you. http://www.codeproject.com/vb/net/netstat.asp and here is a console http proxy source i found as well http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1145&lngWId=10 Hope they help Quote
darkforcesjedi Posted June 13, 2003 Author Posted June 13, 2003 I found the same proxy example but I couldn't access the site. Quote
archer_coal Posted June 14, 2003 Posted June 14, 2003 RE PM me with your EMAIL address and ill email the source to you. Quote
darkforcesjedi Posted June 16, 2003 Author Posted June 16, 2003 Why doesnt this work? IPSocket = New Socket(Net.Sockets.AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp) Dim IPHost As IPHostEntry = Dns.GetHostByAddress("192.168.0.1") Dim sEndPoint As New IPEndPoint(IPHost.AddressList(0).Address, EndPort) IPSocket.Connect(sEndPoint) Dns.GetHostByAddress crashes... Quote
Administrators PlausiblyDamp Posted June 16, 2003 Administrators Posted June 16, 2003 When you say Dns.GetHostByAddress crashes - what exception do you get? Also if you drop to a command prompt and type ping -a 192.168.0.1 what results do you get? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
darkforcesjedi Posted June 17, 2003 Author Posted June 17, 2003 It seems to be failing because the IP address has no DNS entry. I can ping the IP Address, but nslookup [ip address] fails Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.