packages feed

moesocks 1.0.0.10 → 1.0.0.20

raw patch · 7 files changed

+29/−13 lines, 7 filesdep −unix

Dependencies removed: unix

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+1.0.0.20+--------+* Fix respect '--disable-socks5'+ 1.0.0.10 -------- * Add `forbidden_IPs` field in `config.json`
README.md view
@@ -59,11 +59,11 @@ ==========  * UDP over SOCKS5 is not implemented.-* TCP bind over SOCKS5 is not implemented* More then 2 times slower then the original Python implementation (measured at+* TCP bind over SOCKS5 is not implemented * More then 2 times slower then the original Python implementation (measured at   20M/s vs 43M/s on an Intel P8800, using the AES-256-CFB method, in software   AES).-* Currently only works on Linux.+* Currently only works on Unix.   TCP Fast Open (TFO)@@ -114,7 +114,7 @@      echo 1 > /proc/sys/net/ipv4/tcp_ecn -ECN is recommended on both `local` and `remote`.+ECN is recommended only on `remote`.  Credits =======
config.json view
@@ -1,8 +1,8 @@ {   "remoteHost":"0.0.0.0",-  "remotePort":1190,+  "remotePort":8388,   "localHost":"localhost",-  "localPort":1090,+  "localPort":1080,   "password":"birthday!",   "fastOpen":false,   "method":"aes-256-cfb"
moesocks.cabal view
@@ -1,6 +1,6 @@ name:               moesocks category:           Network-version:            1.0.0.10+version:            1.0.0.20 license:            Apache-2.0 synopsis:           A functional firewall killer description:        A SOCKS5 proxy using the client / server architecture.@@ -49,7 +49,7 @@                       , text                       , time                       , transformers-                      , unix+                      --, unix                       , unordered-containers    hs-source-dirs:      src
src/Network/MoeSocks/App.hs view
@@ -21,6 +21,7 @@ runJob aEnv (LocalServiceJob x)  = runLocalService aEnv x  runApp :: Env -> [Job] -> IO ()+runApp _ [] = error_ "No job to run" runApp aEnv someJobs = do   _asyncs <- mapM (async . foreverRun . runJob aEnv) someJobs   waitAnyCancel - _asyncs
src/Network/MoeSocks/Helper.hs view
@@ -27,7 +27,7 @@ import Network.Socket.ByteString import Prelude hiding (take, (-))  import System.Log.Logger-import System.Posix.IO (FdOption(CloseOnExec), setFdOption)+-- import System.Posix.IO (FdOption(CloseOnExec), setFdOption) import System.Random import System.Timeout (timeout) import qualified Data.ByteString as S@@ -448,9 +448,12 @@  -- Copied and slightly modified from:  -- https://github.com/mzero/plush/blob/master/src/Plush/Server/Warp.hs+{-setSocketCloseOnExec :: Socket -> IO ()-}+{-setSocketCloseOnExec aSocket =-}+    {-setFdOption (fromIntegral - fdSocket aSocket) CloseOnExec True-}+ setSocketCloseOnExec :: Socket -> IO ()-setSocketCloseOnExec aSocket =-    setFdOption (fromIntegral - fdSocket aSocket) CloseOnExec True+setSocketCloseOnExec = const - pure ()   tryIO :: String -> IO a -> IO (Either IOException a)
src/Network/MoeSocks/Runtime.hs view
@@ -72,9 +72,17 @@             & _localService        _remoteRelays = [_remote_TCP_Relay, _remote_UDP_Relay]-      _localServices = _localService_TCP_Forwards-                    <> _localService_UDP_Forwards-                    <> pure _localService_SOCKS5+      _localServices = +        let+          _localService_SOCKS5s = +            if someOptions ^. O.disable_SOCKS5+              then []+              else pure _localService_SOCKS5+        in++        _localService_TCP_Forwards+        <> _localService_UDP_Forwards+        <> _localService_SOCKS5s   in    map RemoteRelayJob _remoteRelays