-
Notifications
You must be signed in to change notification settings - Fork 125
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
Host/port binding and reverse proxy #29
base: master
Are you sure you want to change the base?
Conversation
Thank you! I'll take a look and merge it on weekend. |
|
||
You can run Betwixt right away using `npm start`. | ||
|
||
### Running with binding options and reverse proxy mode | ||
|
||
`npm start -- --proxy-port=8010 --proxy-host=0.0.0.0 --reverse-proxy=http://127.0.0.1:8081` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two dashes at the beginning - that's a typo, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so much time to answer. :(
Nope, it is not a typo. They're necessary to propagate the command line arguments to electron.
$ npm start -- --proxy-port=8010 --proxy-host=0.0.0.0 --reverse-proxy=http://127.0.0.1:8081
> betwixt@0.0.0 start /home/mau/dev/betwixt
> electron main.js "--proxy-port=8010" "--proxy-host=0.0.0.0" "--reverse-proxy=http://127.0.0.1:8081"
From https://docs.npmjs.com/cli/run-script:
As of npm@2.0.0, you can use custom arguments when executing scripts. The special option -- is used by getopt to delimit the end of the options. npm will pass all the arguments after the -- directly to your script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation, I didn't know that!
From what I've tested it works great. Please fix mentioned docs typo and I'll merge it. |
@kdzwinel, not sure if you still want to merge this PR. Anyway, please let me know if you want me to rebase the branch. |
@mhnagaoka this time it took me a while to get back to you, sorry! The answer is: yes, absolutely! However, since I had to switch to mitm-proxy in order to support HTTPS (#31 - I'll merge it this week) you should rebase against that branch. It might be a bit challenging though (not sure how reverse proxy works with mitm-proxy), so if you won't find time to do it then I'll try. |
Guys, it is 2018 here :) |
--proxy-host
and--proxy-port
);--reverse-proxy
).