Created
March 11, 2020 13:42
-
-
Save LuoZijun/73950d8549104c8b70e106a633c15657 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo " | |
rdr pass inet proto tcp from any to any port 6000 -> 127.0.0.1 port 8080 | |
" | sudo pfctl -ef - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import socket | |
s = socket.socket() | |
s.bind(("127.0.0.1", 8080)) | |
s.listen(1024) | |
for sock in s.accept(): | |
print(sock) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl "127.0.0.1:6000" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment