Skip to content

Instantly share code, notes, and snippets.

@LuoZijun
Created March 11, 2020 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LuoZijun/73950d8549104c8b70e106a633c15657 to your computer and use it in GitHub Desktop.
Save LuoZijun/73950d8549104c8b70e106a633c15657 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "
rdr pass inet proto tcp from any to any port 6000 -> 127.0.0.1 port 8080
" | sudo pfctl -ef -
#!/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)
#!/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