で ssh トンネルを開き、ssh -D localhost:5678 me@server.com
それを python3 アプリケーションで使用したいと考えています。
#!/usr/bin/python3.1
# -*- coding:Utf-8 -*-
import urllib.request
proxyhand = urllib.request.ProxyHandler({"socks" : "http://localhost:5678"})
opener = urllib.request.build_opener(proxyhand)
page = opener.open("http://www.mysite.com")
mysite.com には、server.com のネットワークからのみアクセスできます (そのため、ssh トンネルを使用しています)。
他の Web サイトには制限なくアクセスできますが、mysite.com では接続タイムアウト エラーが発生します。ここで説明されているように構成されたfirefoxを使用してmysite.comにアクセスできるため、トンネルは機能します。
ありがとうございました