Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Based on the long search in net I came to know that SOCKS uses a handshake protocol to inform the proxy software about the connection that the client is trying to make, and then acts as transparently as possible, whereas an HTTP proxy may interpret and rewrite headers. And we can use both as well.

What I want to know is, how can we find if the proxy is HTTP, SOCKS4, SOCKS4a or SOCKS5? Is there any way to find out? And I can guess that we can't differ it based on port number because there are lot of port numbers available for each of the types. Please help me to differ the proxy based on HTTP or SOCKS.

share|improve this question

Try this little python script:

$ cat 

import struct
import socket
import sys

        server = sys.argv[1]
        port = sys.argv[2]
        print "Usage: server port"

        sen = struct.pack('BBB', 0x05, 0x01, 0x00)
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        s.connect(( server , int( port )  ))
        data = s.recv(2)
        version, auth = struct.unpack('BB', data)
        print 'server : port  is  ', server, ':', port, '; varsion: ', version
except Exception as e:
        print e
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.