CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2015
    Posts
    4

    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

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Convert Sock5 Proxy into Connect

    Quote Originally Posted by gadido30 View Post
    Here is code example:

    http://pastebin.com/iaGqLNSu
    Please attach the code (either using code tags or as an attachment(s)) to your post.
    See the Announcement: Before you post....
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2015
    Posts
    4

    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
  •  





Click Here to Expand Forum to Full Width

Featured