Network.Socks5.Lowlevel

socks-0.5.5: Socks proxy (version 5) implementation.

Safe Haskell | None
Language | Haskell98

Network.Socks5.Lowlevel

Contents

- lowlevel types
- lowlevel interface

Synopsis

- resolveToSockAddr :: SocksAddress -> IO SockAddr
- 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 :: Socket -> [SocksMethod] -> IO SocksMethod
- newtype Connect = Connect SocksAddress
- class Command a where
- connectIPV4 :: Socket -> HostAddress -> PortNumber -> IO (HostAddress, PortNumber)
- connectIPV6 :: Socket -> HostAddress6 -> PortNumber -> IO (HostAddress6, PortNumber)
- connectDomainName :: Socket -> String -> 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

resolveToSockAddr :: SocksAddress -> IO SockAddr #

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

Eq SocksHello # |
Methods (==) :: SocksHello -> SocksHello -> Bool # (/=) :: SocksHello -> SocksHello -> Bool #
Show SocksHello # |
Methods showsPrec :: Int -> SocksHello -> ShowS # show :: SocksHello -> String # showList :: [SocksHello] -> ShowS #
Serialize SocksHello # |
Methods put :: Putter SocksHello # get :: Get SocksHello #

data SocksHelloResponse #

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

Constructors

SocksHelloResponse |
Fields getSocksHelloResponseMethod :: SocksMethod

Instances

Eq SocksHelloResponse # |
Methods (==) :: SocksHelloResponse -> SocksHelloResponse -> Bool # (/=) :: SocksHelloResponse -> SocksHelloResponse -> Bool #
Show SocksHelloResponse # |
Methods showsPrec :: Int -> SocksHelloResponse -> ShowS # show :: SocksHelloResponse -> String # showList :: [SocksHelloResponse] -> ShowS #
Serialize SocksHelloResponse # |
Methods put :: Putter SocksHelloResponse # get :: Get SocksHelloResponse #

data SocksRequest #

Define a SOCKS requests

Constructors

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

Instances

Eq SocksRequest # |
Methods (==) :: SocksRequest -> SocksRequest -> Bool # (/=) :: SocksRequest -> SocksRequest -> Bool #
Show SocksRequest # |
Methods showsPrec :: Int -> SocksRequest -> ShowS # show :: SocksRequest -> String # showList :: [SocksRequest] -> ShowS #
Serialize SocksRequest # |
Methods put :: Putter SocksRequest # get :: Get SocksRequest #
Command SocksRequest # |
Methods toRequest :: SocksRequest -> SocksRequest # fromRequest :: SocksRequest -> Maybe SocksRequest #

data SocksResponse #

Define a SOCKS response

Constructors

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

Instances

Eq SocksResponse # |
Methods (==) :: SocksResponse -> SocksResponse -> Bool # (/=) :: SocksResponse -> SocksResponse -> Bool #
Show SocksResponse # |
Methods showsPrec :: Int -> SocksResponse -> ShowS # show :: SocksResponse -> String # showList :: [SocksResponse] -> ShowS #
Serialize SocksResponse # |
Methods put :: Putter SocksResponse # get :: Get SocksResponse #

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

newtype Connect #

Constructors

Connect SocksAddress |

Instances

Eq Connect # |
Methods (==) :: Connect -> Connect -> Bool # (/=) :: Connect -> Connect -> Bool #
Ord Connect # |
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 #
Show Connect # |
Methods showsPrec :: Int -> Connect -> ShowS # show :: Connect -> String # showList :: [Connect] -> ShowS #
Command Connect # |
Methods toRequest :: Connect -> SocksRequest # fromRequest :: SocksRequest -> Maybe Connect #

class Command a where #

Minimal complete definition

toRequest, fromRequest

Methods

toRequest :: a -> SocksRequest #

fromRequest :: SocksRequest -> Maybe a #

Instances

Command SocksRequest # |
Methods toRequest :: SocksRequest -> SocksRequest # fromRequest :: SocksRequest -> Maybe SocksRequest #
Command Connect # |
Methods toRequest :: Connect -> SocksRequest # fromRequest :: SocksRequest -> Maybe Connect #

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

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

connectDomainName :: Socket -> String -> 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 #