Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Conversation

@nhu
Copy link

@nhu nhu commented Nov 16, 2015

Added the app protocol which is used inside the nw.js container to the proxy whitelist.
Now proxies should work.

Fixes #49

@iamnku
Copy link

iamnku commented Nov 20, 2015

Would love to see this fix get merged soon, as the Gitter desktop client currently doesn't work for anyone that is behind a corporate proxy.

@mydigitalself
Copy link
Contributor

@nhu how can we test it? where does one add the proxy?

@nhu
Copy link
Author

nhu commented Nov 20, 2015

@mydigitalself you can just add a proxy to your system. The old version keeps beeing white on startup because the proxy cannot resolve "app://" requests. So with the fix you bypass the system proxy for "app://" requests and you should see the login page of Gitter.

For testing it on my machine i have picked a random proxy from http://proxylist.hidemyass.com/

@MadLittleMods MadLittleMods changed the title [FIX #49] Gitter wont work behind a proxy Add support proxies Nov 20, 2015
@MadLittleMods MadLittleMods changed the title Add support proxies Add support for proxies Nov 20, 2015
@mydigitalself
Copy link
Contributor

Ah ok, cool, thanks.

I'm on a loaner Macbook at the moment and don't have my full environment setup. Hopefully I'll get my machine back soon and I'll test this out for you.

@johnsonw
Copy link

johnsonw commented Mar 1, 2016

I'm using OS X El Capitan and after setting up the dev environment locally I ran a quick test. I ran npm start and the gitter login window appeared as expected.

I then fetched this PR to a branch I called test using the following command:

git fetch origin pull/80/head:test

After pulling down this patch, I ran npm i again to make sure all dependencies were installed, followed by npm start. The window did not open this time and I received the following output:

[21666:0301/095315:WARNING:dns_config_service_posix.cc(151)] dns_config has unhandled options!
[21666:0301/095315:WARNING:web_database.cc(99)] Web database is too new.
[21666:0301/095315:ERROR:web_data_service_backend.cc(54)] Cannot initialize the web database: 2
[21667:0301/095315:ERROR:breakpad_mac.mm(238)] Breakpad initializaiton failed
[21668:0301/095315:ERROR:breakpad_mac.mm(238)] Breakpad initializaiton failed
[21666:0301/095315:WARNING:nw_form_database_service.cc(21)] initializing autocomplete database failed
[21666:0301/095316:INFO:CONSOLE(38)] ""version:" "2.4.0"", source: app://gitter/index.js (38)
[21666:0301/095316:INFO:CONSOLE(66)] ""Rebuilding tray menu"", source: /Users/wcjohnso/projects/desktop/nwapp/components/tray-menu.js (66)
[21666:0301/095316:INFO:CONSOLE(121)] ""checking" "https://update.gitter.im/osx/package.json" "for app updates"", source: /Users/wcjohnso/projects/desktop/nwapp/utils/auto-update.js (121)
[21666:0301/095316:WARNING:backend_impl.cc(1785)] Destroying invalid entry.

I went back to the master branch and ran npm start to see if the window would come up again and sure enough it did. One thing to note, I am applying an http_proxy and https_proxy environment variable whenever I start an application. To do this, I'm using an environment.plist file in ~/Library/LaunchAgents and the file contents reads:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>my.startup</string>
  <key>ProgramArguments</key>
  <array>
    <string>sh</string>
    <string>-c</string>
    <string>
    launchctl setenv http_proxy xxx
    launchctl setenv https_proxy xxx
    </string>

  </array>
  <key>RunAtLoad</key>
  <true/>
</dict>
</plist>

I also tried unloading this file with:

launchctl unload environment.plist

and then ran npm start again but the window still does no appear. Any idea why the window doesn't launch? If I can provide any more helpful information please let me know. I'll help out any way I can to get this patch landed.

@johnsonw
Copy link

johnsonw commented Mar 1, 2016

My guess is that

[21666:0301/095315:WARNING:dns_config_service_posix.cc(151)] dns_config has unhandled options!

is the culprit. Is that something I need to adjust on my end?

@MadLittleMods
Copy link
Member

@nhu Does this fix still work on #master? @johnsonw tried it and it was not working, https://gitter.im/gitterHQ/desktop?at=56d5b216656b38831abc4e43

@nhu
Copy link
Author

nhu commented Mar 1, 2016

@MadLittleMods hi no this fix does not work because once you passed the trouble with the app framework you will stuck at the oauth2 library which doesnt support proxies. They have also pull requests pending.
So if you would take this PR and change the oauth lib it should work fine.
I have rewritten the client entierly because of that.

Here my gitter client written in es6 and hosted in electron: https://github.com/nhu/gitter2

My own oauth lib written for the client relies on request which supports proxies: https://github.com/nhu/oauthjs

@MadLittleMods
Copy link
Member

@nhu Thanks for the update!

It looks like the oauth package we use is a bit dead and I do see the PR's for proxy support. So we are blocked until we decide on a new oauth package whether it be @nhu's package or otherwise.

@vpavic
Copy link

vpavic commented Oct 25, 2016

Any updates on this? Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants