Network.Socks5.Lowlevel

socks-0.6.1: Socks proxy (ver 5)

Safe Haskell | Safe-Inferred
Language | Haskell2010

Network.Socks5.Lowlevel

Contents

- lowlevel types
- lowlevel interface

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
  }
- establish :: SocksVersion -> Socket -> [SocksMethod] -> IO SocksMethod
- newtype Connect = Connect SocksAddress
- class Command a where
  - toRequest :: a -> SocksRequest
  - fromRequest :: SocksRequest -> Maybe a
- 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

Show SocksHello # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksHello -> ShowS # show :: SocksHello -> String # showList :: [SocksHello] -> ShowS #
Serialize SocksHello # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksHello # get :: Get SocksHello #
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

Show SocksHelloResponse # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksHelloResponse -> ShowS # show :: SocksHelloResponse -> String # showList :: [SocksHelloResponse] -> ShowS #
Serialize SocksHelloResponse # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksHelloResponse # get :: Get SocksHelloResponse #
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

Show SocksRequest # |
Instance details Defined in Network.Socks5.Wire Methods showsPrec :: Int -> SocksRequest -> ShowS # show :: SocksRequest -> String # showList :: [SocksRequest] -> ShowS #
Serialize SocksRequest # |
Instance details Defined in Network.Socks5.Wire Methods put :: Putter SocksRequest # get :: Get SocksRequest #
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

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

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 #

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 #

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

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

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

# lowlevel interface

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 #