18 March 2017

How to test an HTTP proxy by using telnet

What you need

  • A proxy-server host name (for use in the telnet command)
  • The port number of the proxy server (for use in the telnet command)
  • The target server’s host name (for use in the CONNECT request)
  • The port number of the target server (for use in the CONNECT request)

What to do

The initial telnet: > symbolises your shell prompt.

We will contact an SMTP server, but this is just an example; we could just as well connect to a POP, NNTP or other service.

telnet: > telnet proxy.example.com 8080
telnet: Trying 192.0.2.2...
telnet: Connected to 192.0.2.2.
telnet: Escape character is '^]'.
client: CONNECT mx1.example.com:25 HTTP/1.0

server: HTTP/1.0 200 Connection established

server: 220 mx1.example.com ESMTP server ready Thu, 5 Feb 2004 00:38:22 +0200