crypton-socks-0.6.2: SOCKS Protocol Version 5

Copyright | (c) 2010-2019 Vincent Hanquez <vincent@snarc.org>
License | BSD-style
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Network.Socks5.Types

Description

Synopsis

- data SocksVersion = SocksVer5
- data SocksCommand
  - = SocksCommandConnect
  - | SocksCommandBind
  - | SocksCommandUdpAssociate
  - | SocksCommandOther !Word8
- data SocksMethod
  - = SocksMethodNone
  - | SocksMethodGSSAPI
  - | SocksMethodUsernamePassword
  - | SocksMethodOther !Word8
  - | SocksMethodNotAcceptable
- data SocksHostAddress
  - = SocksAddrIPV4 !HostAddress
  - | SocksAddrDomainName !SocksFQDN
  - | SocksAddrIPV6 !HostAddress6
- data SocksAddress = SocksAddress !SocksHostAddress !PortNumber
- data SocksReply
  - = SocksReplySuccess
  - | SocksReplyError SocksError
- data SocksVersionNotSupported = SocksVersionNotSupported
- data SocksError
  - = SocksErrorGeneralServerFailure
  - | SocksErrorConnectionNotAllowedByRule
  - | SocksErrorNetworkUnreachable
  - | SocksErrorHostUnreachable
  - | SocksErrorConnectionRefused
  - | SocksErrorTTLExpired
  - | SocksErrorCommandNotSupported
  - | SocksErrorAddrTypeNotSupported
  - | SocksErrorOther Word8
- type SocksFQDN = ByteString

# Documentation

data SocksVersion Source #

Type representing SOCKS protocol versions.

Constructors

SocksVer5 | SOCKS Protocol Version 5. The only version implemented by the library.

#### Instances

Instances details

Show SocksVersion Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksVersion -> ShowS Source # show :: SocksVersion -> String Source # showList :: [SocksVersion] -> ShowS Source #
Eq SocksVersion Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksVersion -> SocksVersion -> Bool Source # (/=) :: SocksVersion -> SocksVersion -> Bool Source #
Ord SocksVersion Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksVersion -> SocksVersion -> Ordering Source #

(<) :: SocksVersion -> SocksVersion -> Bool Source #

(<=) :: SocksVersion -> SocksVersion -> Bool Source #

(>) :: SocksVersion -> SocksVersion -> Bool Source #

(>=) :: SocksVersion -> SocksVersion -> Bool Source #

max :: SocksVersion -> SocksVersion -> SocksVersion Source #

min :: SocksVersion -> SocksVersion -> SocksVersion Source #

data SocksCommand Source #

Type representing commands that can be sent or received under the SOCKS protocol.

Constructors

SocksCommandConnect | The CONNECT request.
SocksCommandBind | The BIND request. Not implemented by the library.
SocksCommandUdpAssociate | The UDP ASSOCIATE request. Not implemented by the library.
SocksCommandOther !Word8 | Other requests. None are specified by the SOCKS Protocol Version 5.

#### Instances

Instances details

Enum SocksCommand Source # |

Instance details

Defined in Network.Socks5.Types

Methods

succ :: SocksCommand -> SocksCommand Source #

pred :: SocksCommand -> SocksCommand Source #

toEnum :: Int -> SocksCommand Source #

fromEnum :: SocksCommand -> Int Source #

enumFrom :: SocksCommand -> [SocksCommand] Source #

enumFromThen :: SocksCommand -> SocksCommand -> [SocksCommand] Source #

enumFromTo :: SocksCommand -> SocksCommand -> [SocksCommand] Source #

enumFromThenTo :: SocksCommand -> SocksCommand -> SocksCommand -> [SocksCommand] Source #

Show SocksCommand Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksCommand -> ShowS Source # show :: SocksCommand -> String Source # showList :: [SocksCommand] -> ShowS Source #
Eq SocksCommand Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksCommand -> SocksCommand -> Bool Source # (/=) :: SocksCommand -> SocksCommand -> Bool Source #
Ord SocksCommand Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksCommand -> SocksCommand -> Ordering Source #

(<) :: SocksCommand -> SocksCommand -> Bool Source #

(<=) :: SocksCommand -> SocksCommand -> Bool Source #

(>) :: SocksCommand -> SocksCommand -> Bool Source #

(>=) :: SocksCommand -> SocksCommand -> Bool Source #

max :: SocksCommand -> SocksCommand -> SocksCommand Source #

min :: SocksCommand -> SocksCommand -> SocksCommand Source #

data SocksMethod Source #

Type representing authentication methods available under the SOCKS protocol.

Only `SocksMethodNone` is effectively implemented, but other values are enumerated for completeness.

Constructors

SocksMethodNone | NO AUTHENTICATION REQUIRED.
SocksMethodGSSAPI | GSSAPI.
SocksMethodUsernamePassword | USERNAME/PASSWORD.
SocksMethodOther !Word8 | IANA ASSIGNED or RESERVED FOR PRIVATE METHODS.
SocksMethodNotAcceptable | NO ACCEPTABLE METHODS.

#### Instances

Instances details

Enum SocksMethod Source # |

Instance details

Defined in Network.Socks5.Types

Methods

succ :: SocksMethod -> SocksMethod Source #

pred :: SocksMethod -> SocksMethod Source #

toEnum :: Int -> SocksMethod Source #

fromEnum :: SocksMethod -> Int Source #

enumFrom :: SocksMethod -> [SocksMethod] Source #

enumFromThen :: SocksMethod -> SocksMethod -> [SocksMethod] Source #

enumFromTo :: SocksMethod -> SocksMethod -> [SocksMethod] Source #

enumFromThenTo :: SocksMethod -> SocksMethod -> SocksMethod -> [SocksMethod] Source #

Show SocksMethod Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksMethod -> ShowS Source # show :: SocksMethod -> String Source # showList :: [SocksMethod] -> ShowS Source #
Eq SocksMethod Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksMethod -> SocksMethod -> Bool Source # (/=) :: SocksMethod -> SocksMethod -> Bool Source #
Ord SocksMethod Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksMethod -> SocksMethod -> Ordering Source #

(<) :: SocksMethod -> SocksMethod -> Bool Source #

(<=) :: SocksMethod -> SocksMethod -> Bool Source #

(>) :: SocksMethod -> SocksMethod -> Bool Source #

(>=) :: SocksMethod -> SocksMethod -> Bool Source #

max :: SocksMethod -> SocksMethod -> SocksMethod Source #

min :: SocksMethod -> SocksMethod -> SocksMethod Source #

data SocksHostAddress Source #

Type representing host addresses under the SOCKS protocol.

Constructors

SocksAddrIPV4 !HostAddress | A version-4 IP address.
SocksAddrDomainName !SocksFQDN | A fully-qualified domain name (FQDN).
SocksAddrIPV6 !HostAddress6 | A version-6 IP address.

#### Instances

Instances details

Show SocksHostAddress Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksHostAddress -> ShowS Source # show :: SocksHostAddress -> String Source # showList :: [SocksHostAddress] -> ShowS Source #
Eq SocksHostAddress Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksHostAddress -> SocksHostAddress -> Bool Source # (/=) :: SocksHostAddress -> SocksHostAddress -> Bool Source #
Ord SocksHostAddress Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksHostAddress -> SocksHostAddress -> Ordering Source #

(<) :: SocksHostAddress -> SocksHostAddress -> Bool Source #

(<=) :: SocksHostAddress -> SocksHostAddress -> Bool Source #

(>) :: SocksHostAddress -> SocksHostAddress -> Bool Source #

(>=) :: SocksHostAddress -> SocksHostAddress -> Bool Source #

max :: SocksHostAddress -> SocksHostAddress -> SocksHostAddress Source #

min :: SocksHostAddress -> SocksHostAddress -> SocksHostAddress Source #

data SocksAddress Source #

Type representing socket addresses under the SOCKS protocol.

Constructors

SocksAddress !SocksHostAddress !PortNumber |

#### Instances

Instances details

Show SocksAddress Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksAddress -> ShowS Source # show :: SocksAddress -> String Source # showList :: [SocksAddress] -> ShowS Source #
Eq SocksAddress Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksAddress -> SocksAddress -> Bool Source # (/=) :: SocksAddress -> SocksAddress -> Bool Source #
Ord SocksAddress Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksAddress -> SocksAddress -> Ordering Source #

(<) :: SocksAddress -> SocksAddress -> Bool Source #

(<=) :: SocksAddress -> SocksAddress -> Bool Source #

(>) :: SocksAddress -> SocksAddress -> Bool Source #

(>=) :: SocksAddress -> SocksAddress -> Bool Source #

max :: SocksAddress -> SocksAddress -> SocksAddress Source #

min :: SocksAddress -> SocksAddress -> SocksAddress Source #

data SocksReply Source #

Type representing replies under the SOCKS protocol.

Constructors

SocksReplySuccess | The server reports that the request succeeded.
SocksReplyError SocksError | The server reports that the request did not succeed.

#### Instances

Instances details

Data SocksReply Source # |

Instance details

Defined in Network.Socks5.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SocksReply -> c SocksReply Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SocksReply Source #

toConstr :: SocksReply -> Constr Source #

dataTypeOf :: SocksReply -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SocksReply) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SocksReply) Source #

gmapT :: (forall b. Data b => b -> b) -> SocksReply -> SocksReply Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SocksReply -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SocksReply -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SocksReply -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SocksReply -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SocksReply -> m SocksReply Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksReply -> m SocksReply Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksReply -> m SocksReply Source #

Enum SocksReply Source # |

Instance details

Defined in Network.Socks5.Types

Methods

succ :: SocksReply -> SocksReply Source #

pred :: SocksReply -> SocksReply Source #

toEnum :: Int -> SocksReply Source #

fromEnum :: SocksReply -> Int Source #

enumFrom :: SocksReply -> [SocksReply] Source #

enumFromThen :: SocksReply -> SocksReply -> [SocksReply] Source #

enumFromTo :: SocksReply -> SocksReply -> [SocksReply] Source #

enumFromThenTo :: SocksReply -> SocksReply -> SocksReply -> [SocksReply] Source #

Show SocksReply Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksReply -> ShowS Source # show :: SocksReply -> String Source # showList :: [SocksReply] -> ShowS Source #
Eq SocksReply Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksReply -> SocksReply -> Bool Source # (/=) :: SocksReply -> SocksReply -> Bool Source #
Ord SocksReply Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksReply -> SocksReply -> Ordering Source #

(<) :: SocksReply -> SocksReply -> Bool Source #

(<=) :: SocksReply -> SocksReply -> Bool Source #

(>) :: SocksReply -> SocksReply -> Bool Source #

(>=) :: SocksReply -> SocksReply -> Bool Source #

max :: SocksReply -> SocksReply -> SocksReply Source #

min :: SocksReply -> SocksReply -> SocksReply Source #

data SocksVersionNotSupported Source #

Type representing exceptions.

Constructors

SocksVersionNotSupported | The SOCKS protocol version is not supported. This library only implements SOCKS Protocol Version 5.

#### Instances

Instances details

Data SocksVersionNotSupported Source # |

Instance details

Defined in Network.Socks5.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SocksVersionNotSupported -> c SocksVersionNotSupported Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SocksVersionNotSupported Source #

toConstr :: SocksVersionNotSupported -> Constr Source #

dataTypeOf :: SocksVersionNotSupported -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SocksVersionNotSupported) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SocksVersionNotSupported) Source #

gmapT :: (forall b. Data b => b -> b) -> SocksVersionNotSupported -> SocksVersionNotSupported Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SocksVersionNotSupported -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SocksVersionNotSupported -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SocksVersionNotSupported -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SocksVersionNotSupported -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SocksVersionNotSupported -> m SocksVersionNotSupported Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksVersionNotSupported -> m SocksVersionNotSupported Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksVersionNotSupported -> m SocksVersionNotSupported Source #

Exception SocksVersionNotSupported Source # |
Instance details Defined in Network.Socks5.Types Methods toException :: SocksVersionNotSupported -> SomeException Source # fromException :: SomeException -> Maybe SocksVersionNotSupported Source # displayException :: SocksVersionNotSupported -> String Source # backtraceDesired :: SocksVersionNotSupported -> Bool Source #
Show SocksVersionNotSupported Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksVersionNotSupported -> ShowS Source # show :: SocksVersionNotSupported -> String Source # showList :: [SocksVersionNotSupported] -> ShowS Source #

data SocksError Source #

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

Constructors

SocksErrorGeneralServerFailure | General SOCKS server failure.
SocksErrorConnectionNotAllowedByRule | Connection not allowed by ruleset.
SocksErrorNetworkUnreachable | Network unreachable.
SocksErrorHostUnreachable | Host unreachable.
SocksErrorConnectionRefused | Connection refused.
SocksErrorTTLExpired | TTL expired.
SocksErrorCommandNotSupported | Command not supported.
SocksErrorAddrTypeNotSupported | Address type not supported.
SocksErrorOther Word8 | Other error. Unassigned in SOCKS Protocol Version 5.

#### Instances

Instances details

Data SocksError Source # |

Instance details

Defined in Network.Socks5.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SocksError -> c SocksError Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SocksError Source #

toConstr :: SocksError -> Constr Source #

dataTypeOf :: SocksError -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SocksError) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SocksError) Source #

gmapT :: (forall b. Data b => b -> b) -> SocksError -> SocksError Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SocksError -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SocksError -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SocksError -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SocksError -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SocksError -> m SocksError Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksError -> m SocksError Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SocksError -> m SocksError Source #

Enum SocksError Source # |

Instance details

Defined in Network.Socks5.Types

Methods

succ :: SocksError -> SocksError Source #

pred :: SocksError -> SocksError Source #

toEnum :: Int -> SocksError Source #

fromEnum :: SocksError -> Int Source #

enumFrom :: SocksError -> [SocksError] Source #

enumFromThen :: SocksError -> SocksError -> [SocksError] Source #

enumFromTo :: SocksError -> SocksError -> [SocksError] Source #

enumFromThenTo :: SocksError -> SocksError -> SocksError -> [SocksError] Source #

Exception SocksError Source # |
Instance details Defined in Network.Socks5.Types Methods toException :: SocksError -> SomeException Source # fromException :: SomeException -> Maybe SocksError Source # displayException :: SocksError -> String Source # backtraceDesired :: SocksError -> Bool Source #
Show SocksError Source # |
Instance details Defined in Network.Socks5.Types Methods showsPrec :: Int -> SocksError -> ShowS Source # show :: SocksError -> String Source # showList :: [SocksError] -> ShowS Source #
Eq SocksError Source # |
Instance details Defined in Network.Socks5.Types Methods (==) :: SocksError -> SocksError -> Bool Source # (/=) :: SocksError -> SocksError -> Bool Source #
Ord SocksError Source # |

Instance details

Defined in Network.Socks5.Types

Methods

compare :: SocksError -> SocksError -> Ordering Source #

(<) :: SocksError -> SocksError -> Bool Source #

(<=) :: SocksError -> SocksError -> Bool Source #

(>) :: SocksError -> SocksError -> Bool Source #

(>=) :: SocksError -> SocksError -> Bool Source #

max :: SocksError -> SocksError -> SocksError Source #

min :: SocksError -> SocksError -> SocksError Source #

type SocksFQDN = ByteString Source #

Type synonym representing fully-qualified domain names (FQDN). The SOCKS Protocol Version 5 does not specify an encoding for a FQDN other than there is no terminating `NUL` octet (byte).

This library's API assumes that FQDN values comprise only ASCII characters. Domain names that include other Unicode code points should be Punycode encoded.