socks-0.5.4: 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
  - toRequest :: a -> SocksRequest
  - fromRequest :: SocksRequest -> Maybe a
- 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 Source

socksListen :: Socket -> IO SocksRequest Source

# lowlevel types

data SocksHello Source

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

Constructors

SocksHello |

Fields

getSocksHelloMethods :: [SocksMethod]

Instances

Eq SocksHello Source |
Show SocksHello Source |
Serialize SocksHello Source |

data SocksHelloResponse Source

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

Constructors

SocksHelloResponse |

Fields

getSocksHelloResponseMethod :: SocksMethod

Instances

Eq SocksHelloResponse Source |
Show SocksHelloResponse Source |
Serialize SocksHelloResponse Source |

data SocksRequest Source

Define a SOCKS requests

Constructors

SocksRequest |

Fields

requestCommand :: SocksCommand
requestDstAddr :: SocksHostAddress
requestDstPort :: PortNumber

Instances

Eq SocksRequest Source |
Show SocksRequest Source |
Serialize SocksRequest Source |
Command SocksRequest Source |

data SocksResponse Source

Define a SOCKS response

Constructors

SocksResponse |

Fields

responseReply :: SocksReply
responseBindAddr :: SocksHostAddress
responseBindPort :: PortNumber

Instances

Eq SocksResponse Source |
Show SocksResponse Source |
Serialize SocksResponse Source |

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

newtype Connect Source

Constructors

Connect SocksAddress |

Instances

Eq Connect Source |
Ord Connect Source |
Show Connect Source |
Command Connect Source |

class Command a where Source

Methods

toRequest :: a -> SocksRequest Source

fromRequest :: SocksRequest -> Maybe a Source

Instances

Command SocksRequest Source |
Command Connect Source |

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

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

connectDomainName :: Socket -> String -> PortNumber -> IO (SocksHostAddress, PortNumber) Source

# lowlevel interface

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

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

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

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