
をリッスンするサーバーがあり、 Chrome 拡張機能 (一部の JSON データ) からのhttp://localhost:3000
すべてのリクエストを に転送したいと考えています。http://api.lingualeo.com/addword
http://localhost:3000
私がしたこと:
# sysctl -w net/ipv4/conf/all/route_localnet=1
# iptables -t nat -A OUTPUT -p tcp -m string \
--string "POST /addword?port=1001" --algo kmp \
-j DNAT --to-destination 127.0.0.1:3000
しかし、それは機能せず、私のものiptables -nvL
はきれいになりました。
私は試した:
# iptables -t nat -A OUTPUT -p tcp -m string \
--string "POST /addword?port=1001" --algo kmp \
-o lo -j REDIRECT --to-ports 3000</code>
それもうまくいかず、私のはiptables -nvL
きれいになりました。
しかし、ブロッキングhttp://api.lingualeo.com/addword
次のコマンドで要求します。
# iptables -I OUTPUT -p tcp -m string \
--string "POST /addword?port=1001" --algo kmp -j DROP
期待通りに動作しました。
OS: Linux x64