win10 wsl 实验
win10启动http文件服务器
python -m http.server --bind 127.0.0.1 8888 # win10执行
本地端口转发
ssh -N -L 10802:127.0.0.1:8888 owen@winhost # wsl执行
curl http://127.0.0.1:10802 # wsl执行,访问win10的http文件服务器
远程端口转发
ssh -N -R 10802:127.0.0.1:8888 z@wslhost # win10执行。ssh至wsl并创建端口10802
curl http://127.0.0.1:10802 # wsl执行,访问win10的http文件服务器
动态端口转发
ssh -N -D 10802 owen@winhost # wsl执行。ssh至win
curl --proxy socks5://localhost:10802 http://127.0.0.1:8888 # wsl执行,访问win10的http文件服务器
all_proxy=socks5://localhost:10802 curl http://127.0.0.1:8888 # wsl执行,访问win10的http文件服务器