Coder Social home page Coder Social logo

Comments (9)

avwo avatar avwo commented on May 1, 2024 1

试试这个
https://zm10.sm-tc.cn/?src=l4uLj8XQ0IiIiNGeloqHlp6R0ZyQktCejYuWnJOa0I%2FSzcfLy8vKydGXi5KT&uid=a2e611ebc1cc7336dcb0b3adae5c987a&hid=bb6c854ab810f85587f4c60078884180&pos=8&cid=9&time=1497240345012&from=click&restype=1&pagetype=0200000000000400&bu=structure_web_kv&query=curl%E8%AE%BE%E7%BD%AE%E4%BB%A3%E7%90%86&mode=&v=1&uc_param_str=dnntnwvepffrgibijbprsvdsdichei

from whistle.

xinshangshangxin avatar xinshangshangxin commented on May 1, 2024

node中使用request的呢?

from whistle.

avwo avatar avwo commented on May 1, 2024

const r = request.defaults({ proxy: 'http://127.0.0.1:8899' });

https://github.com/request/request#streaming

from whistle.

avwo avatar avwo commented on May 1, 2024

也可以参考这里面的实现 https://github.com/avwo/koa-whistle

from whistle.

xinshangshangxin avatar xinshangshangxin commented on May 1, 2024

不合理啊, 难道我还要区分正式环境 和 测试环境, 来修改代码?
如果是系统级别的host, 是不需要的

from whistle.

avwo avatar avwo commented on May 1, 2024

操作系统设置的系统代理是指浏览器代理,app内部的请求要做指定代理需要自己用代码实现,一般是加个配置界面让用户自己填写;用proxifier全局代理到同台机器的whistle不可取,会造成whistle发出的请求又被proxifier代理回来,造成死循环。

from whistle.

xinshangshangxin avatar xinshangshangxin commented on May 1, 2024

那样的话感觉有点绕了, 原来只要开启proxifier 就可以代理全部了
现在还需要配置, 有点麻烦了

另外, 系统host配合nginx 也是可以达到效果, 虽然有点麻烦, 但是不需要修改原有实现

from whistle.

avwo avatar avwo commented on May 1, 2024

whistle和proxifier不要在同一台机器运行就可以

from whistle.

xinshangshangxin avatar xinshangshangxin commented on May 1, 2024

好吧, 最后还是 搭配 nginx + host

利用host 决定哪个域名需要转发到本地, 然后nginx 配置default_server 转发到 127.0.0.1:8899
最后利用 whistle 来决定 真正的转发

感觉太绕了....

from whistle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.