-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Socks proxy (version 5) implementation.
--   
--   Socks proxy (version 5) implementation.
@package socks
@version 0.4.1


module Network.Socks5

-- | SOCKS configuration structure. this structure will be extended in
--   future to support authentification. use defaultSocksConf to create new
--   record.
data SocksConf
SocksConf :: String -> PortNumber -> Int -> SocksConf

-- | SOCKS host.
socksHost :: SocksConf -> String

-- | SOCKS port.
socksPort :: SocksConf -> PortNumber

-- | SOCKS version to use, only 5 supported for now.
socksVersion :: SocksConf -> Int

-- | defaultSocksConf create a new record, making sure API remains
--   compatible when the record is extended.
defaultSocksConf :: String -> PortNumber -> SocksConf

-- | connect a new socket to the socks server, and connect the stream on
--   the server side to the sockaddr specified. the sockaddr need to be
--   SockAddrInet or SockAddrInet6.
--   
--   a unix sockaddr will raises an exception.
--   
--   
--   |socket|-----sockServer-----&gt;|server|----destAddr-----&gt;|destination|
socksConnectAddr :: Socket -> SockAddr -> SockAddr -> IO ()

-- | connect a new socket to the socks server, and connect the stream to a
--   FQDN resolved on the server side.
socksConnectName :: Socket -> SockAddr -> String -> PortNumber -> IO ()

-- | similar to Network connectTo but use a socks proxy with default socks
--   configuration.
socksConnectTo :: String -> PortID -> String -> PortID -> IO Handle

-- | create a new socket and connect in to a destination through the
--   specified SOCKS configuration.
socksConnectWith :: SocksConf -> String -> PortID -> IO Socket
