Skip to content

Host/port binding and reverse proxy - #29

Open
mhnagaoka wants to merge 2 commits into
kdzwinel:masterfrom
Arizona-Tecnologia:reverse-proxy
Open

Host/port binding and reverse proxy#29
mhnagaoka wants to merge 2 commits into
kdzwinel:masterfrom
Arizona-Tecnologia:reverse-proxy

Conversation

@mhnagaoka

Copy link
Copy Markdown
  • Adds command line configuration options to allow specifying the IP/port to bind to (--proxy-host and --proxy-port);
  • Adds a command line options for activating a reverse proxy mode (i.e. forwards the requests to the same server, --reverse-proxy).

@kdzwinel

Copy link
Copy Markdown
Owner

Thank you! I'll take a look and merge it on weekend.

Comment thread docs/building.md

Copy link
Copy Markdown
Owner

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?

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Owner

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!

@kdzwinel

Copy link
Copy Markdown
Owner

From what I've tested it works great. Please fix mentioned docs typo and I'll merge it.

@mhnagaoka

Copy link
Copy Markdown
Author

@kdzwinel, not sure if you still want to merge this PR. Anyway, please let me know if you want me to rebase the branch.

@kdzwinel

Copy link
Copy Markdown
Owner

@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.

@Guria

Guria commented Aug 9, 2018

Copy link
Copy Markdown

Guys, it is 2018 here :)

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

Successfully merging this pull request may close these issues.

3 participants