Thread: Socks5 protocol

  1. #16
    Registered User
    Join Date
    Jan 2011
    Posts
    12
    I think i managed to resolved this in an easy way,the diferents betweend the second packet i receive and the one i send is that only the second byte is changed,in rest the packets are the same,so a only chnaged temp[1] and resend it back,and it doesnt give me error anymore,it says is connected
    About the thread thing: after the authentification i need to create a thread,and in the function thread to call connect between a mutex,something like that ?

    Code:
    void* func(void* arg)
    {
      pthread_mutex_lock (&mutex);
       Connect(address, port);
       pthread_mutex_unlock (&mutex);
    }
    
    pthread_t thread;
    int rc;
    rc = pthread_create(&thread,NULL, func, NULL);
    edit: but i still need a way to get address,so i can connect to it...How can i do that ?

    edit2: i resolved this too,the first 4 bytes are version/connection type/reserved/adress type(ip address,not domain) so i didnt checked to see if the address is an ip or domain name,it is ip(like in my case) then the next 4 bytes in the ip ,in my case(91-58-82-24) is the ip i was testing for a domain so thats why it take 91 as a lenght.
    Last edited by vbx_wx; 02-03-2011 at 06:38 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 10-04-2010, 10:09 AM
  2. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  3. Networking Protocol
    By Hunter2 in forum Networking/Device Communication
    Replies: 14
    Last Post: 12-11-2003, 04:51 PM
  4. help on protocol
    By Prasad kulkarni in forum C Programming
    Replies: 3
    Last Post: 10-20-2002, 08:54 AM
  5. HTTP Protocol :: Winsock
    By kuphryn in forum Windows Programming
    Replies: 9
    Last Post: 06-21-2002, 03:07 PM