Network.Socks5.Lowlevel

socks-0.6.1: Socks proxy (ver 5)

Safe Haskell | None
Language | Haskell2010

Network.Socks5.Lowlevel

Contents

- lowlevel types

Synopsis

- socksListen :: Socket -> IO SocksRequest
- data SocksHello = SocksHello {
  - getSocksHelloMethods :: [SocksMethod]
  }
- data SocksHelloResponse = SocksHelloResponse {
  - getSocksHelloResponseMethod :: SocksMethod
  }
- data SocksRequest = SocksRequest {
  - requestCommand :: SocksCommand
  - requestDstAddr :: SocksHostAddress
  - requestDstPort :: PortNumber
  }
- data SocksResponse = SocksResponse {
  - responseReply :: SocksReply
  - responseBindAddr :: SocksHostAddress
  - responseBindPort :: PortNumber
  }
- class Command a where
  - toRequest :: a -> SocksRequest
  - fromRequest :: SocksRequest -> Maybe a
- establish :: SocksVersion -> Socket -> [SocksMethod] -> IO SocksMethod
- newtype Connect = Connect SocksAddress
- connectIPV4 :: Socket -> HostAddress -> PortNumber -> IO (HostAddress, PortNumber)
- connectIPV6 :: Socket -> HostAddress6 -> PortNumber -> IO (HostAddress6, PortNumber)
- connectDomainName :: Socket -> [Char] -> PortNumber -> IO (SocksHostAddress, PortNumber)
- rpc :: Command a => Socket -> a -> IO (Either SocksError (SocksHostAddress, PortNumber))
- rpc_ :: Command a => Socket -> a -> IO (SocksHostAddress, PortNumber)
- sendSerialized :: Serialize a => Socket -> a -> IO ()
- waitSerialized :: Serialize a => Socket -> IO a

# Documentation

socksListen :: Socket -> IO SocksRequest #

# lowlevel types

data SocksHello #

Initial message sent by client with the list of authentification methods supported

Constructors

SocksHello |
Fields getSocksHelloMethods :: [SocksMethod]

#### Instances

Instances details

Serialize SocksHello # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksHello # get :: Get SocksHello #
Show SocksHello # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksHello -> ShowS # show :: SocksHello -> String # showList :: [SocksHello] -> ShowS #
Eq SocksHello # |
Instance details Defined in Network.Socks5.Wire Methods (==) :: SocksHello -> SocksHello -> Bool # (/=) :: SocksHello -> SocksHello -> Bool #

data SocksHelloResponse #

Initial message send by server in return from Hello, with the server chosen method of authentication

Constructors

SocksHelloResponse |
Fields getSocksHelloResponseMethod :: SocksMethod

#### Instances

Instances details

Serialize SocksHelloResponse # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksHelloResponse # get :: Get SocksHelloResponse #
Show SocksHelloResponse # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksHelloResponse -> ShowS # show :: SocksHelloResponse -> String # showList :: [SocksHelloResponse] -> ShowS #
Eq SocksHelloResponse # |
Instance details Defined in Network.Socks5.Wire Methods (==) :: SocksHelloResponse -> SocksHelloResponse -> Bool # (/=) :: SocksHelloResponse -> SocksHelloResponse -> Bool #

data SocksRequest #

Define a SOCKS requests

Constructors

SocksRequest |
Fields requestCommand :: SocksCommand requestDstAddr :: SocksHostAddress requestDstPort :: PortNumber

#### Instances

Instances details

Serialize SocksRequest # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksRequest # get :: Get SocksRequest #
Show SocksRequest # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksRequest -> ShowS # show :: SocksRequest -> String # showList :: [SocksRequest] -> ShowS #
Eq SocksRequest # |
Instance details Defined in Network.Socks5.Wire Methods (==) :: SocksRequest -> SocksRequest -> Bool # (/=) :: SocksRequest -> SocksRequest -> Bool #
Command SocksRequest # |
Instance details Defined in Network.Socks5.Command Methods toRequest :: SocksRequest -> SocksRequest # fromRequest :: SocksRequest -> Maybe SocksRequest #

data SocksResponse #

Define a SOCKS response

Constructors

SocksResponse |
Fields responseReply :: SocksReply responseBindAddr :: SocksHostAddress responseBindPort :: PortNumber

#### Instances

Instances details

Serialize SocksResponse # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksResponse # get :: Get SocksResponse #
Show SocksResponse # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksResponse -> ShowS # show :: SocksResponse -> String # showList :: [SocksResponse] -> ShowS #
Eq SocksResponse # |
Instance details Defined in Network.Socks5.Wire Methods (==) :: SocksResponse -> SocksResponse -> Bool # (/=) :: SocksResponse -> SocksResponse -> Bool #

class Command a where #

Methods

toRequest :: a -> SocksRequest #

fromRequest :: SocksRequest -> Maybe a #

#### Instances

Instances details

Command Connect # |
Instance details Defined in Network.Socks5.Command Methods toRequest :: Connect -> SocksRequest # fromRequest :: SocksRequest -> Maybe Connect #
Command SocksRequest # |
Instance details Defined in Network.Socks5.Command Methods toRequest :: SocksRequest -> SocksRequest # fromRequest :: SocksRequest -> Maybe SocksRequest #

establish :: SocksVersion -> Socket -> [SocksMethod] -> IO SocksMethod #

newtype Connect #

Constructors

Connect SocksAddress |

#### Instances

Instances details

Show Connect # |
Instance details Defined in Network.Socks5.Command Methods showsPrec :: Int -> Connect -> ShowS # show :: Connect -> String # showList :: [Connect] -> ShowS #
Eq Connect # |
Instance details Defined in Network.Socks5.Command Methods (==) :: Connect -> Connect -> Bool # (/=) :: Connect -> Connect -> Bool #
Ord Connect # |
Instance details Defined in Network.Socks5.Command Methods compare :: Connect -> Connect -> Ordering # (<) :: Connect -> Connect -> Bool # (<=) :: Connect -> Connect -> Bool # (>) :: Connect -> Connect -> Bool # (>=) :: Connect -> Connect -> Bool # max :: Connect -> Connect -> Connect # min :: Connect -> Connect -> Connect #
Command Connect # |
Instance details Defined in Network.Socks5.Command Methods toRequest :: Connect -> SocksRequest # fromRequest :: SocksRequest -> Maybe Connect #

connectIPV4 :: Socket -> HostAddress -> PortNumber -> IO (HostAddress, PortNumber) #

connectIPV6 :: Socket -> HostAddress6 -> PortNumber -> IO (HostAddress6, PortNumber) #

connectDomainName :: Socket -> [Char] -> PortNumber -> IO (SocksHostAddress, PortNumber) #

rpc :: Command a => Socket -> a -> IO (Either SocksError (SocksHostAddress, PortNumber)) #

rpc_ :: Command a => Socket -> a -> IO (SocksHostAddress, PortNumber) #

sendSerialized :: Serialize a => Socket -> a -> IO () #

waitSerialized :: Serialize a => Socket -> IO a #