-
March 12th, 2015, 02:47 AM
#1
Convert Sock5 Proxy into Connect
Hi All,
I have some socks5 server code and other code that connect to server,
I want to bind both codes , so I can connect without sock5 server, is there way to bind the two codes?
Here is code example:
http://pastebin.com/iaGqLNSu
Thank You
Gdi
-
March 12th, 2015, 04:09 AM
#2
Re: Convert Sock5 Proxy into Connect
Originally Posted by gadido30
Please attach the code (either using code tags or as an attachment(s)) to your post.
See the Announcement: Before you post....
Victor Nijegorodov
-
March 12th, 2015, 04:26 AM
#3
Re: Convert Sock5 Proxy into Connect
Sorry, Its my first post,
Thank You
Code:
//SOCKS5 Proxy Example
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
IPEndPoint localEndPoint = null;
localEndPoint = new IPEndPoint(IPAddress.Loopback, _config.localPort);
_socket.Bind(localEndPoint);
_socket.Listen(1024);
_socket.BeginAccept(
new AsyncCallback(AcceptCallback),
_socket);
//Socket Connect Example
Public Socket localClient = null;
IPEndPoint remote = new IPEndPoint(ipAddress, 3030);
localClient = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
localClient.Connect(remote);
IPAddress localIP = IPAddress.Parse(((IPEndPoint)localClient.RemoteEndPoint).Address.ToString());
Console.WriteLine(localIP);
clients.Add(localClient);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|