我正在使用带有 Spy-js 集成的 WebStorm 8
(更多 http://blog.jetbrains.com/webstorm/2014/04/spy-js-webstorm-secret-service/ )
当我从 IDE 运行配置运行 SpyJS 时,我无法让它捕获请求
当我通过本地代理模式访问 URL 时,http://localhost:3546/?spy-js=localhost:9000
它有效,但有其局限性...(更多 https://github.com/spy-js/spy-js#local-proxy )
系统代理似乎配置正确:
http://localhost:3546/spy-js-proxy.pac
的内容是
function FindProxyForURL(url, host) { return "PROXY localhost:3546; DIRECT"; }
从 WebStorm 跟踪代理日志
/usr/local/bin/node /opt/homebrew-cask/Caskroom/webstorm/8.0.0/WebStorm.app/plugins/spy-js/server/spy.js --port=3546
session store created: /var/folders/gm/r9vjzd1926v4sxdv54c9tl240000gn/T/spy-js-session114324-29723-1xl36wv
Starting 8 workers..
info: socket.io started
spy-js has started, proxy is available at http://localhost:3546
session (qzj9e): new session created: qzj9e
session (qzj9e): dynamic config created: /var/folders/gm/r9vjzd1926v4sxdv54c9tl240000gn/T/114324-29723-1yo5izj.js
session (qzj9e): new session started: qzj9e
Worker 29770 ready.
Worker 29768 ready.
Worker 29769 ready.
Worker 29771 ready.
Worker 29773 ready.
Worker 29772 ready.
Worker 29774 ready.
Worker 29775 ready.
proxy connection issue: socket hang up
最佳答案
首先,尝试清除“要跟踪的 URL”字段(可选),重新启动跟踪 session 并强制刷新页面。如果有效,则可能是 URL 问题(尝试使用 localhost 而不是 0.0.0.0)。
此外,如果您使用的是 Chrome,当跟踪 session 正在运行时,请确保 chrome://net-internals/#proxy 页面“有效代理设置”正在使用 spy-js-proxy.pac(如果没有,请尝试重新-应用设置或清除页面上的错误代理列表(如果有)。
关于javascript - WebStorm 中的 Spy-JS 未捕获,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23267605/