Fix decoding error in socks5 proxy

Former-commit-id: 9251838d41ccb1e4806bc1450449ff2f4aeb0ad6
Former-commit-id: 7ee0bce8c007f91e0e313bf654217afe69702b70 [formerly d3f0883653a31df2eb6bc175c496251d0b2edea7] [formerly 5054071b3247e7ba1f04047d042ccff1dcfe5c70 [formerly 4016899bb03a38fc0b7c5888d8cd2ff30235e79d [formerly 4016899bb03a38fc0b7c5888d8cd2ff30235e79d [formerly 4016899bb03a38fc0b7c5888d8cd2ff30235e79d [formerly 4a5393b3b78ba039647a8bb9c920b4b1dec9c069]]]]]
Former-commit-id: 5a9ba40b828143d78d72992c0a5c7af4967eaffa [formerly 47aafb56d26a6d879d9d6cecf6fd7696809cca70]
Former-commit-id: 33174940425cb1a5bcefa5cc0b89ac795dbd29ce
Former-commit-id: b0e7b47cbca9ddc0e9b1e0502ecce96f719792fb
Former-commit-id: 04a32b4fec4bce8f6dc6e86ee1548c9798eb6b71
Former-commit-id: 3632695f26111d824378fb54dc63746e27f7d087 [formerly a2acc19e7c559a2a694ef9246dba5040d064ca60]
Former-commit-id: 1e692f7bee881d1981d9fa4153e697db0f0521c9
This commit is contained in:
Romain GÉRARD 2020-02-24 21:17:35 +01:00
parent cce0c73296
commit 0e51c51cfb

View file

@ -117,7 +117,7 @@ runSocks5Server socksSettings@Socks5.ServerSettings{..} cfg inner = do
N.runTCPServer (N.serverSettingsTCP (fromIntegral listenOn) (fromString bindOn)) $ \cnx -> do
-- Get the auth request and response with a no Auth
authRequest <- decode . fromStrict <$> N.appRead cnx :: IO Socks5.ResponseAuth
authRequest <- decode . fromStrict <$> N.appRead cnx :: IO Socks5.RequestAuth
debug $ "Socks5 authentification request " <> show authRequest
let responseAuth = encode $ Socks5.ResponseAuth (fromIntegral Socks5.socksVersion) Socks5.NoAuth
N.appWrite cnx (toStrict responseAuth)