1

I am using .net core Couchbase Mobile Lite client 2.5 on Windows 10. My machine is part of my corporate network while the Sync Gateway runs in our companies openshift platform in another network.

From my machine I can reach the Sync Gateway public Admin API on port 4985 using http successfully! If I call https://my-sync-gateway/mydb in the browser I get:

{"ADMIN":true,"mydb":"Welcome","vendor":{"name":"Couchbase Sync Gateway","version":"2.5"},"version":"Couchbase Sync Gateway/2.5.0(271;bf3ddf6) EE"}

If I try to replicate my local 'mydb' like this:

_urlEndpoint = new URLEndpoint(new Uri($"wss://my-syncg-gateway:4985/mydb"));

_replicatorConfig = new ReplicatorConfiguration(this._database, _urlEndpoint);
_replicatorConfig.Authenticator = new SessionAuthenticator(sessionId);
_replicatorConfig.ReplicatorType = ReplicatorType.PushAndPull;
_replicatorConfig.Continuous = true;

_replicator = new Replicator(_replicatorConfig);
_replicator.AddChangeListener(this.ReplicationEventHandler);

then I get an Exception in function CreateProxyAsync(Uri destination) class WindowsProxy.cs line:

return Task.FromResult(new WebProxy(new Uri($"http://{url}"), bypass?.Contains("<local>") ?? false, bypass));

the exception is caused by null value of url in new Uri($"http://{url}")

Everything works find if my client and sync gateway are located in the same network.

Unfortunately I didn't find any possibility to configure the ReplicationConfiguration class to pass through proxies.

How can the client be configured correctly to pass through proxies?

Is my problem above related to this issue: https://github.com/couchbase/couchbase-lite-net/issues/1002 ?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Siraf
  • 1,133
  • 9
  • 24

1 Answers1

1

If you have your Sync gateway behind a proxy, double check you have websockets enabled on your proxy

Couple of points orthogonal to the issue,

From my machine I can reach the Sync Gateway public Admin API on port 4985 using http successfully

you must never expose 4985 (admin port) over external network - that is the admin port. So make sure you only have 4984 exposed.

Also, it seems like you have a single Sync Gateway exposed directly over the Internet . It would be recommended to have a load balancer service in front of your sync gateway pods and keep the pods internal

rajagp
  • 1,443
  • 8
  • 10