HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulecrypton-socks-0.6.2Haskell2010

Network.Socks5

This is an implementation of the SOCKS Protocol Version 5 as defined in RFC 1928.

In Wikipedia's words:

SOCKS is an Internet protocol that exchanges network packets between a client and server through a proxy server. SOCKS5 optionally provides authentication so only authorized users may access a server. Practically, a SOCKS server proxies TCP connections to an arbitrary IP address, and provides a means for UDP packets to be forwarded. A SOCKS server accepts incoming client connection on TCP port 1080.

BIND and UDP ASSOCIATE messages are not implemented. However the main usage of SOCKS is implemented.

  • 5 types
  • 6 values

Types

4 declarations
datadata SocksHostAddress
#

Type representing host addresses under the SOCKS protocol.

Constructors

Instances3Eq, Ord, Show
datadata SocksReply
#

Type representing replies under the SOCKS protocol.

Constructors

Instances5Enum, Eq, Data, Ord, Show
  • Enum SocksReplyDefined in crypton-socks-0.6.2 · Network.Socks5.Types
  • Eq SocksReplyDefined in crypton-socks-0.6.2 · Network.Socks5.Types
  • Data SocksReplyDefined in crypton-socks-0.6.2 · Network.Socks5.Types
  • Ord SocksReplyDefined in crypton-socks-0.6.2 · Network.Socks5.Types
  • Show SocksReplyDefined in crypton-socks-0.6.2 · Network.Socks5.Types
datadata SocksError
#

Type representing SOCKS errors that can be part of a SOCKS reply.

Constructors

Instances6Enum, Eq, Data, Ord, Show, Exception

Configuration

4 declarations

Methods

2 declarations
valuesocksConnectWithSocket
  1. :: Socket

    The socket to use.

  2. -> SocksConf

    The SOCKS configuration for the server.

  3. -> SocksAddress

    The SOCKS address to connect to.

  4. -> IO (SocksHostAddress, PortNumber)
#

Connect a user-specified new socket on the SOCKS server to a destination.

The specified socket needs to be connected to the SOCKS server already.

|socket|-----sockServer----->|server|----destAddr----->|destination|

Variants

1 declaration
valuesocksConnectName
  1. :: Socket

    The socket to use. The socket must *not* be connected already.

  2. -> SocksConf

    The SOCKS configuration for the server.

  3. -> String

    Destination FQDN. Should comprise only ASCII characters, otherwise unexpected behaviour will ensure. For FQDN including other Unicode code points, Punycode encoding should be used.

  4. -> PortNumber

    The port number to use.

  5. -> IO ()
#

Connect a new socket to the SOCKS server, and connect the stream to a fully-qualified domain name (FQDN) resolved on the server side.