Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature]支持作为另一台机器的反向代理 #875

Open
junbujianwpl opened this issue Mar 30, 2023 · 6 comments
Open

[feature]支持作为另一台机器的反向代理 #875

junbujianwpl opened this issue Mar 30, 2023 · 6 comments

Comments

@junbujianwpl
Copy link

痛点:chrome devtool调试在本机能访问,例如通过localhost:7777,但是在另一台机器上通过 192.168.1.32:7777这种ip的形式无法访问,如果要做的话,还得开个HttpProxy,类似这种做法 https://stackoverflow.com/a/61867570/7720976

能否whistle支持一下,在另一台机上是可以通过ip访问到whistle的控制台的,能否给这个控制台url加些子path,可以通过规则匹配到本机的特定端口网页

或者是否还有别的方式来实现这个需求,求大佬指点

@avwo
Copy link
Owner

avwo commented Mar 30, 2023

试试路径加 -
localhost:7777/-/path/to -> localhost:7777/path/to

@junbujianwpl
Copy link
Author

junbujianwpl commented Apr 7, 2023

试试路径加 -localhost:7777/-/path/to -> localhost:7777/path/to

localhost:8888/-/abc http://127.0.0.1:7777
localhost:8888/-/abc http://127.0.0.1:7777
localhost:8888/abc http://127.0.0.1:7777
localhost:8888/abc http://127.0.0.1:7777

localhost:7777/-/abc http://127.0.0.1:7777
localhost:7777/-/abc https://127.0.0.1:7777


localhost:8888/-/abc http://127.0.0.1:7777
localhost:8888/abc http://127.0.0.1:7777
localhost:8888/abc http://127.0.0.1:7777

在rules里配了这一串 都不管用 像是没法把本机的一个端口给反向代理出去? www.baddomain.com http://localhost:7777 这个是有效的

@avwo
Copy link
Owner

avwo commented Apr 7, 2023

localhost:8888/-/abc 访问, Whistle 会放过请求并自动转成 localhost:8888/abc,规则里面要匹配的 URL 是 localhost:8888/abc

@junbujianwpl
Copy link
Author

localhost:8888/-/abc 访问, Whistle 会放过请求并自动转成 localhost:8888/abc,规则里面要匹配的 URL 是 localhost:8888/abc

localhost:8888/-/abc 怎么映射到 localhost:7777 呢
localhost:7777是真实的devtool端口 想从另一台机器通过ip来访问到这个devtool

@avwo
Copy link
Owner

avwo commented Apr 8, 2023

在whistle 上配规则 localhost:8888 localhost:7777

@junbujianwpl
Copy link
Author

在whistle 上配规则 localhost:8888 localhost:7777

localhost:8888 localhost:7777
localhost:7777/ localhost:7777/-/

配置了这样2条规则,本机确实可以了,开始报了个ECONNREFUSED,重启了下代理,不设置bypass,又好了。这是本机,能行,本机localhost:8888/-/能看到devtool
但是从另一台机器访问还是有问题,用ip访问 192.168.0.103:8888/-/访问的是whistle代理的界面,而且有一个死循环的get,一直都是200
http://192.168.0.103:8888/cgi-bin/get-data?clientId=1681148072090-1&startLogTime=-2&startSvrLogTime=-2&ids=1681148211096-195&startTime=1681148211096-195&dumpCount=0&lastRowId=1681148211096-195&logId=&count=20&_=1681148071987

加了这样一条配置也无效192.168.0.103:8888 localhost:7777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants