Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 heroku/sinatra 的新手,并且有一个带有 oauth 回调 URL 的应用程序。最简单的做法似乎是修改/etc/hosts以欺骗我本地机器上的生产 URL,循环回127.0.0.1
/etc/hosts
127.0.0.1
问题是当我在本地使用工头或霰弹枪时,他们不在端口 80 上侦听(我不希望他们不听)
由 localhost:5000 向 my-app.herokuapp.com:80 发出请求的最佳方式是什么?
我也试图实现这样的目标,但是在不运行代理的情况下无法将请求从一个端口定向到另一个端口(即将请求从浏览器中的 80 端口定向到服务器上的 5000)。
但是,我得到了这个相当接近的解决方法:
# in your /etc/hosts file: 127.0.0.1 my-app.herokuapp.com
然后,如果您的 Shotgun 在端口 5000 上运行,您应该能够http://my-app.herokuapp.com:5000在浏览器中访问。
http://my-app.herokuapp.com:5000