crypton-socks-0.6.2: SOCKS Protocol Version 5
Copyright(c) 2010-2019 Vincent Hanquez <vincent@snarc.org>
LicenseBSD-style
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Network.Socks5.Lowlevel

Description

Low level types and functions for interacting with a SOCKS server.

Synopsis

Documentation

socksListen Source #

Arguments

:: Socket

The socket to use.

-> IO SocksRequest 

For the specified socket, wait for a SOCKS Hello, send a SOCKS Hello response (specifying no authentification method), and wait for a SOCKS request.

Low level types and functions

newtype SocksHello Source #

Type representing initial messages sent by a client with the list of authentification methods supported.

Constructors

SocksHello 

Instances

Instances details
Show SocksHello Source # 
Instance details

Defined in Network.Socks5.Wire

Serialize SocksHello Source # 
Instance details

Defined in Network.Socks5.Wire

Eq SocksHello Source # 
Instance details

Defined in Network.Socks5.Wire

newtype SocksHelloResponse Source #

Type representing initial messages sent by a server in response to Hello, with the server's chosen method of authentication.

data SocksResponse Source #

Type representing SOCKS responses.

Instances

Instances details
Show SocksResponse Source # 
Instance details

Defined in Network.Socks5.Wire

Serialize SocksResponse Source # 
Instance details

Defined in Network.Socks5.Wire

Eq SocksResponse Source # 
Instance details

Defined in Network.Socks5.Wire

class Command a where Source #

A type class for types that can yield a SOCKS request or, optionally, be obtained from a SOCKS request.

newtype Connect Source #

Type representing connect commands.

Constructors

Connect SocksAddress 

Instances

Instances details
Show Connect Source # 
Instance details

Defined in Network.Socks5.Command

Command Connect Source # 
Instance details

Defined in Network.Socks5.Command

Eq Connect Source # 
Instance details

Defined in Network.Socks5.Command

Methods

(==) :: Connect -> Connect -> Bool #

(/=) :: Connect -> Connect -> Bool #

Ord Connect Source # 
Instance details

Defined in Network.Socks5.Command

establish Source #

Arguments

:: SocksVersion

The SOCKS protocol version to use.

-> Socket

The socket to use.

-> [SocksMethod]

A list of the authentification methods supported.

-> IO SocksMethod 

Establish a connection with a SOCKS server.

rpc_ Source #

Arguments

:: Command a 
=> Socket

The socket to use.

-> a

The command.

-> IO (SocksHostAddress, PortNumber) 

As for rpc but throws an exception if it does not succeed.

connectIPV4 Source #

Arguments

:: Socket

The socket to use.

-> HostAddress

The host address.

-> PortNumber

The port number to use.

-> IO (HostAddress, PortNumber) 

Connect using IPv4.

connectIPV6 Source #

Arguments

:: Socket

The socket to use.

-> HostAddress6

The host address.

-> PortNumber

The port number to use.

-> IO (HostAddress6, PortNumber) 

Connect using IPv6.

connectDomainName Source #

Arguments

:: Socket

The socket to use.

-> 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.

-> PortNumber

The port number to use.

-> IO (SocksHostAddress, PortNumber) 

Connect using a fully-qualified domain name (FQDN).

rpc Source #

Arguments

:: Command a 
=> Socket

The socket to use.

-> a

The command.

-> IO (Either SocksError (SocksHostAddress, PortNumber)) 

Try to execute the specified command with the specified socket.

sendSerialized Source #

Arguments

:: Serialize a 
=> Socket

The socket to use.

-> a

The data.

-> IO () 

Send data to the specified socket.

waitSerialized Source #

Arguments

:: Serialize a 
=> Socket

The socket to use.

-> IO a 

Wait for data from the specified socket.