Changeset d8298c6


Ignore:
Timestamp:
Jan 24, 2009 5:27:06 PM (12 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ae0bcc49
Parents:
9a089b7
Message:

http error message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKSServerFactory.java

    r9a089b7 rd8298c6  
    88
    99import java.io.DataInputStream;
     10import java.io.DataOutputStream;
    1011import java.io.IOException;
    1112import java.net.Socket;
     
    1920    private final static Log _log = new Log(SOCKSServerFactory.class);
    2021
     22    private final static String ERR_REQUEST_DENIED =
     23        "HTTP/1.1 403 Access Denied\r\n" +
     24        "Content-Type: text/html; charset=iso-8859-1\r\n" +
     25        "Cache-control: no-cache\r\n" +
     26        "\r\n" +
     27        "<html><body><H1>I2P SOCKS PROXY ERROR: REQUEST DENIED</H1>" +
     28        "Your browser is misconfigured. This is a SOCKS proxy, not a HTTP proxy" +
     29        "</body></html>";
     30   
    2131    /**
    2232     * Create a new SOCKS server, using the provided socket (that must
     
    3949                serv = new SOCKS5Server(s);
    4050                break;
     51            case 'C':
     52            case 'G':
     53            case 'H':
     54            case 'P':
     55                DataOutputStream out = new DataOutputStream(s.getOutputStream());
     56                out.write(ERR_REQUEST_DENIED.getBytes());
     57                throw new SOCKSException("HTTP request to socks");
    4158            default:
    4259                throw new SOCKSException("SOCKS protocol version not supported (" + Integer.toHexString(socksVer) + ")");
Note: See TracChangeset for help on using the changeset viewer.