Created
October 5, 2012 11:02
-
-
Save kyo-ago/3839254 to your computer and use it in GitHub Desktop.
local ipの入ったpacの自動生成(外部から参照する用pacを生成する時用)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function OnBeforeResponse(oSession: Session) | |
{ | |
if (oSession.uriContains('/fiddler.pac')) (function () { | |
var e = new Enumerator(GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")); | |
var ip = ""; | |
for(; !e.atEnd(); e.moveNext()) { | |
ip = e.item().IPAddress(0); | |
break; | |
} | |
oSession.utilSetResponseBody("function FindProxyForURL(url, host) { return 'PROXY "+ip+":8888'; }"); | |
})(); | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
そもそもいらなかった
proxy.pacでのmyIpAddress() - (ひ)メモ http://d.hatena.ne.jp/hirose31/20070823/1187852191