# Development:Implement a behind a proxy sync solution

**URL:** <https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043>\
**Category:** Development\
**Created:** [13 November 2018 19:40 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043 "2018-11-13T19:40:00Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhlevca](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bhlevca](https://discourse.joplinapp.org/u/bhlevca)\
**Post date:** [13 November 2018 19:40 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/1 "2018-11-13T19:40:00Z")

</div>

I read an exchange about this topic on github and I believe that this excellent app would benefit from making it able to communicate behind the proxy. The are a few related topics on this forum but none is a clear request about making Joplin’s sync function work behind a proxy.

It appears there is a way to force node.js apps to go through a proxy with **global-tunnel-ng**

```auto
var globalTunnel = require('global-tunnel-ng');
 
globalTunnel.initialize({
    host: '10.0.0.10',
    port: 8080,
    proxyAuth: 'userId:password', // optional authentication
    sockets: 50 // optional pool size for each http and https
});

```

[Read](https://www.npmjs.com/package/global-tunnel-ng)

Perhaps this is the way to go.

---

<div class="post-metadata">

**Author:** ![aviret](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aviret/32/924_2.png) [@aviret](https://discourse.joplinapp.org/u/aviret)\
**Post date:** [12 February 2020 13:01 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/2 "2020-02-12T13:01:16Z")

</div>

Hello,

I have just tried this way, and this works (tested with WevDAV through a proxy) !

Thanks for the suggestion !

---

<div class="post-metadata">

**Author:** ![bhlevca](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bhlevca](https://discourse.joplinapp.org/u/bhlevca)\
**Post date:** [12 February 2020 16:07 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/3 "2020-02-12T16:07:38Z")

</div>

I’m glad that it worked. I am surprised that the author did not take this suggestion seriously about a year ago when I mentioned it.

I hope that your success will attract more attention to this solution.

---

<div class="post-metadata">

**Author:** ![bhlevca](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bhlevca](https://discourse.joplinapp.org/u/bhlevca)\
**Post date:** [12 February 2020 16:52 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/4 "2020-02-12T16:52:00Z")

</div>

Thank you for letting me know.

If you have the time please provide a quick recipe describing how you have done it , what files have been modified, etc.

Thanks

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [12 February 2020 22:01 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/5 "2020-02-12T22:01:30Z")

</div>

@aviret Laurent mentioned he would add it, if there’s a solution that works. So if yours does, create a PR and you have added proxy support to Joplin. Wouldn’t that be something?

@bhlevca ir’s more than likely that Laurent missed your post. I did. And I try to read and look at every topic, but sometimes there are just too many.

---

<div class="post-metadata">

**Author:** ![aviret](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aviret/32/924_2.png) [@aviret](https://discourse.joplinapp.org/u/aviret)\
**Post date:** [13 February 2020 08:01 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/6 "2020-02-13T08:01:52Z")

</div>

Hello,

I have inserted your code and update my proxy server in the following file ElectronClient/app/gui/MainScreen.jsx. Then I have to load the module with ‘npm install global-tunnel-ng’, recompile and that’s it.

Greetings

---

<div class="post-metadata">

**Author:** ![aviret](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aviret/32/924_2.png) [@aviret](https://discourse.joplinapp.org/u/aviret)\
**Post date:** [13 February 2020 08:04 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/7 "2020-02-13T08:04:15Z")

</div>

Before doing a PR, I do not know how to get the system proxy config in Joplin or how to add the parameters in the sync config.

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [13 February 2020 09:18 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/8 "2020-02-13T09:18:20Z")

</div>

@aviret can you please blank out the user/pwd and host with ` ***** ` and send us the file `ElectronClient/app/gui/MainScreen.jsx`. You can zip it and attach it here.

---

<div class="post-metadata">

**Author:** ![aviret](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aviret/32/924_2.png) [@aviret](https://discourse.joplinapp.org/u/aviret)\
**Post date:** [13 February 2020 09:39 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/9 "2020-02-13T09:39:22Z")

</div>

Here is the file [MainScreen.jsx.zip](https://discourse.joplinapp.org/uploads/short-url/epkwoJDDrXt8fkicjIEwzWePKyF.zip) (5.4 KB)

---

<div class="post-metadata">

**Author:** ![tessus](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/tessus/32/13_2.png) [@tessus](https://discourse.joplinapp.org/u/tessus)\
**Post date:** [13 February 2020 09:48 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/10 "2020-02-13T09:48:18Z")

</div>

Thanks, I’m gonna have a look at it.

Somehow, we have to find a way to make it work for all platforms.

---

<div class="post-metadata">

**Author:** ![aviret](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/aviret/32/924_2.png) [@aviret](https://discourse.joplinapp.org/u/aviret)\
**Post date:** [13 February 2020 10:16 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/11 "2020-02-13T10:16:32Z")

</div>

I have made the test with a release from the tag 7ad407a8c8060b412640ef6066709b7e46c7dffb ( **tag: v1.0.175** ), but now with the last release of master, I get this message when checking the config:  
Cannot read property ‘proxy’ of undefined. I will redo a checkout to this release and keep you informed.

---

<div class="post-metadata">

**Author:** ![nVir](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@nVir](https://discourse.joplinapp.org/u/nVir)\
**Post date:** [14 February 2020 16:35 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/12 "2020-02-14T16:35:41Z")

</div>

@tessus Found this: [Sadly global-tunnel-ngis broken since Node.js 11.6.0 and according to one of the contributors it probably won’t support newer Node versions in the future.](https://github.com/yeoman/yo/issues/616). I will continue with by switching from using `global-tunnel-ng` to [global-agent](https://github.com/gajus/global-agent).

---

<div class="post-metadata">

**Author:** ![bhlevca](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bhlevca](https://discourse.joplinapp.org/u/bhlevca)\
**Post date:** [14 February 2020 16:59 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/13 "2020-02-14T16:59:25Z")

</div>

@nVir Could you post a solution here with the global-agent? Some details about what files are modified, platform, file sources (Git or precompiled, etc.) thanks.

---

<div class="post-metadata">

**Author:** ![bhlevca](https://avatars.discourse-cdn.com/v4/letter/b/838e76/32.png) [@bhlevca](https://discourse.joplinapp.org/u/bhlevca)\
**Post date:** [14 February 2020 18:18 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/14 "2020-02-14T18:18:36Z")

</div>

I just read that global-agent supports only node.js 12.0 and above. It will not work with older versions. A bit of a mess in the node.js networking world

---

<div class="post-metadata">

**Author:** ![nVir](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@nVir](https://discourse.joplinapp.org/u/nVir)\
**Post date:** [17 February 2020 10:37 UTC](https://discourse.joplinapp.org/t/development-implement-a-behind-a-proxy-sync-solution/1043/15 "2020-02-17T10:37:56Z")

</div>

Hello,

PR has been made, see: [https://github.com/laurent22/joplin/pull/2515](https://github.com/laurent22/joplin/pull/2515)

Greetings
