Firefoxããsshã®ãã¤ãããã¯è»¢éã使ã£ã¦éå ¬éãµã¼ãã¸ã¢ã¯ã»ã¹ãã
ãsshã«ã¯ãã¤ãããã¯è»¢éã¨ããæ©è½ãããããã®æ©è½ã使ãã¨ãsshã¯ã¢ããªã±ã¼ã·ã§ã³å´ã«ã¯SOCKSããã¯ã·ã¨ãã¦æ¯ãèãããããããsshã®æ¥ç¶å
ã¾ã§ã¯æå·åãããç¶æ
ã§éä¿¡ãè¡ãããã
ãããã ãã ã¨é常ã®ãã³ããªã³ã°ã¨ã©ãéãã®ãããããããªããããããªããããã¤ãããã¯è»¢éã®å ´åã¯è»¢éãã¼ããæå®ããå¿
è¦ããªããããããã¤ãããã¯ã¨è¡¨ç¾ãããæ以ã ããã
ãä¾ãã°ããªãã£ã¹Aã«ããéçºãµã¼ãdev1ã«ãªãã£ã¹å¤ããã¢ã¯ã»ã¹ãããã¨ãããããããdev1ã¯ãªãã£ã¹å¤ã«ã¯å
¬éããã¦ããããè¸ã¿å°ãµã¼ãladd1ãçµç±ãã¦ããã¢ã¯ã»ã¹ãããããªããladd1ã¯sshã®ã¿ãåãã¦ãããããã¾ã§ã¯sshã®ãã³ããªã³ã°æ©è½ã使ã£ã¦ã¢ã¯ã»ã¹ãã¦ããã®ã ããã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ããããã°ããéã¯ãã¡ãã¡ã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ã®ãã¼ãæ¯ã«ãã³ãã«ãæãã®ãé¢åãããããªãã£ã¹ã«éãããã¼ã¿ã»ã³ã¿ã¼ã¸ã®ã¢ã¯ã»ã¹ãªã©ã§ãåæ§ã®åé¡ã¯ããè¦ããããããããéã«ãã¤ãããã¯è»¢éã使ããã
ãã¾ãåææ¡ä»¶ã¨ãã¦ãåºæ¬çã«ã使ãããã¢ããªã±ã¼ã·ã§ã³ã¯SOCKSãããã·ã«å¯¾å¿ãã¦ããæ¹ãè¯ããï¼ç¡çããå
¨é¨ã®éä¿¡ããããã·çµç±ã«ãã¦ãã¾ãããã°ã©ã ã¯ããã®ã§ãå¿
é ã§ã¯ãªããï¼å¹¸ããFirefox, IE, Google Chromeãããã®ãã©ã¦ã¶ã¯å
¨é¨SOCKSãããã·ã«å¯¾å¿ãã¦ãããä»åã¯Firefoxã使ãã
ãã¾ããsshã§ãã¤ãããã¯è»¢éãè¡ããã³ãã«ãæããããã¯é常ã«ç°¡åã§ã
ssh -D portnum ladd1
ãã¨ããã¨ã ãã§è¯ãã-Dã¯Dynamicã®æã§ãããportnumã¯é©å½ãªæ°å¤ã§è¯ãããSOCKSã®ãã¼ãçªå·ã¯1080çªãä¸è¬çãããã®ã§ã使ãããªãã°1080ã«ãã¦ããã¨è¯ãããã
ã次ã«ãFirefoxå´ã®è¨å®ã«ç§»ããFirefoxã«ã¯Proxy auto-configã¨ããæ©è½ããããJavaScriptã§ã©ã®ãã¹ãã¸ã®ã¢ã¯ã»ã¹ãã©ã®ãµã¼ãçµç±ã§è¡ãããã¨ãããã¨ãã«ã¹ã¿ãã¤ãºã§ãããä»åã®ä¾ã ã¨ã以ä¸ã®ãããªJavaScriptã«ãªãã
function FindProxyForURL(url, host) { if (host == "dev1") { return "SOCKS5 127.0.0.1:portnum"; } return "DIRECT"; }
ãããããproxy.pacã¨ããããªååãã¤ãã¦ä¿åãããdev1ã¨portnumã®ãããã¯èªåã®ç°å¢ã«åããã¦ã«ã¹ã¿ãã¤ãºããå¿
è¦ããããurlã¨hostãå¼æ°ã«æ¸¡ããã¦ããã®ã§ãããã使ã£ã¦ããªãèªç±ã«ããã¯ã·ãµã¼ãã®è¨å®ãã§ããã®ã ããé¢åãããã調ã¹ãã°è±å¯ã«æ
å ±ãè¦ã¤ããã®ã§çç¥ãFindProxyForURLã¨ãã§æ¤ç´¢ããã¨ããã§ãã
ããã¤ã³ãã¯SOCKS5ã¨æ¸ãã¨ããã§ãããã«ãã£ã¦ããã¯ã·ãµã¼ãã¨ã®ãããã³ã«ãSOCKS5ã§ãããã¨ãæå®ãã¦ãããåã«SOCKSã¨æ¸ããã ããããã¾ãéä¿¡ãã¦ãããªã(ãã¶ãSOCKS4ã«ãªã£ã¦ãããããªããã¨æã)ãã注æãããã¨ããã®æ
å ±ãæ¥æ¬èªã§è¦ã¤ãããªãã£ãã®ããä»ãã®ã¨ã³ããªãæ¸ãã¦ãã主è¦å ã§ããã
ãproxy.pacãã§ããããFirefoxãããã使ãããã«æå®ãããã¾ããè¨å®ç»é¢ããã詳細ãâããããã¯ã¼ã¯ãâãæ¥ç¶è¨å®ãã§ãããã·ã®è¨å®ç»é¢ãéããè¨å®ã¯ãã¶ãããããã·ã使ç¨ããªããã«ãªã£ã¦ããã®ã§ããèªåãããã·è¨å®ã¹ã¯ãªããURLãã«å¤æ´ãããã¡ã¤ã«åãå
¥åãããURLã¨ãªã£ã¦ãããããã¡ã¤ã«é¸æãã¤ã¢ãã°ããªãã®ã ãããã¡ã¤ã«åãå
¥åããã¨ããã使ã£ã¦ãããããã ãããã¡ã¤ã«åãfile:///ã§å§ã¾ããã¨ã«æ³¨æããå¿
è¦ããããã¹ã©ãã·ã¥ã®æ°ã3ã¤ã§ãããã¨ã«æ³¨æãLinuxã¨ãã ã¨ãfile:///home/tkng/proxy.pacãã¨ããæãã§è¨å®ã§ãããWindowsã®å ´åãã¹ã©ãã·ã¥ã®æ°ãã©ããªãã®ãã¯ããããããªãã試è¡é¯èª¤ãå¿
è¦ãããããªãã
ããã¹ã¦ããã¾ãããã°ãFirefoxã®ãã±ã¼ã·ã§ã³ãã¼ã«http://dev1/ã¨æã¡è¾¼ãã¨ãladd1çµç±ã§dev1ã¸ã¨ã¢ã¯ã»ã¹ã§ãããhttp://dev1:3000/ã¨ãããã¼ãçªå·ãèªç±ã«å¤æ´ã§ãããåå解決ã«å¤±æããå ´åã¯ãnetwork.proxy.socks_remote_dnsã®è¨å®ãtrueã«å¤æ´ããã¨ããã ããã
ãããã¾ã§ã¯åæç¥ã£ããæ®éã®ãã³ããªã³ã°ã§ãªãã¨ã対å¦ãã¦ããã®ã ããã©ãä¸åãã¤ãããã¯è»¢éã使ãã¨ãããæ®éã®ãã³ããªã³ã°ã«ã¯æ»ãæ°ãèµ·ããªããã¡ãã£ã¨ããæéã®å·®ã§ãããªããã ãã©ãããã¯ä¾¿å©ã ã
ã以ä¸è¿½è¨ï¼
- èªã¿è¿ãã¨ã©ãããã¤ãããã¯è»¢éã®é
åãªã®ãããããããªãã£ãã®ã§ãæ¹ãã¦èª¬æãã¦ããã¾ããä¸çªé
åçãªã®ã¯ããµã¼ãåã«ãã£ã¦ããã¯ã·ã®ä½¿ç¨ã«ã¤ãã¦ã«ã¹ã¿ãã¤ãºãã§ããç¹ã§ãããã«ãã£ã¦ä»¥ä¸ã®ãããªã¡ãªãããå¾ããã¾ãããã®3ã¤ãå
¨é¨æç«ããææ³ã¯ãä»ã®ã¨ãããã¤ãããã¯è»¢é+Proxy auto-configã®çµã¿åããããç¥ããªãã
- ãã¡ãã¡localhostã®ç¹å®ã®ãã¼ãã«ãã³ããªã³ã°ãããæéãçãããä»ãã¼ã«ã«ãã·ã³ã®ã©ã®ãã¼ãã«ã©ã®ãµã¼ãã®ä½çªã®ãã¼ãã転éãã¦ããã®ãããããã³ã°ããã¡ãã¡è¨æ¶ãã¦ããã¨å²ã¨ã¹ãã¬ã¹ããã¾ãã
- è¦ãããã¼ããå¢ãã度ã«ãã¡ãã¡ãã³ãã«ãæããªãã¦ããããããã°æã¯å¥ãã¼ãã§ãã¹ããµã¼ããç«ã¦ãããããã®ã§ããã®çµæãããã«ãã©ã¦ã¶ã§ç¢ºèªã§ããã¨ããããã
- ãµã¼ãåã«ãã£ã¦ã©ã®ããã¯ã·ã使ãã®ããåãæ¿ãããããã¤ã¾ãã2ã¤ä»¥ä¸ã®ããã¯ã·ãåæã«ä½¿ç¨ãããã¨ãã§ããã
- ãã¯ãã³ã¡ã³ãã§id:hogemãããGoogle Chromeã®SOCKS対å¿ãçåè¦ããã¦ãã¾ãããã調ã¹ã¦ã¿ã¾ãããGoogle Chromeã¯ã¾ã SOCKSãããã·ã«å¯¾å¿ãã¦ã¾ããã§ãããGoogle Summmer of Code 2009で開発予定だそうですã