Internet Direct (Indy) Version 9.0.1 Beta
TIdSocksInfo.MakeSocks4Connection
Establishes the socket connection used for a SOCKS proxy connection.

procedure MakeSocks4Connection(const AHost: string; const APort: Integer);
Parameters
const AHost: string
Host name or IP address for a socks connection request.

const APort: Integer
Port number for a socks connection request.

Description
MakeSocks4Connection is a procedure that establishes the TIdTCPConnection used for a SOCKS proxy connection. MakeSocks4Connection is called from MakeSocksConnection when the value in Version is svSocks4 or svSocks4A.

MakeSocks4Connection sets the OpCode and Version number for the TIdSocksRequest sent to the proxy server at the location specified in AHost and APort. MakeSocks4Connection will use the host address '0.0.0.1' when Version contains the value svSocks4A.

MakeSocks4Connection also sets the identity for the SOCKS request to the value specified in Username.

MakeSocks4Connection writes the SOCKS request to the Connection for the proxy, and reads the SOCKS response packet. MakeSocks4Connection can raise an exception when the TIdSocksResponse.OpCode contains one of the following values: