Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Reaching the URI

 Post Reply Post Reply
Author
Eduardo Elias View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 May 2014
Posts: 233
Post Options Post Options   Quote Eduardo Elias Quote  Post ReplyReply Direct Link To This Post Topic: Reaching the URI
    Posted: 18 Aug 2014 at 10:10pm
Wagner,

This is a question valid for 2 forums, so I am posting in this place.

In some cases I am using Aurelius with RemoteDB Client.

However there is a situation that I don't know how to handle seamlessly:

I have an internal server, ip 192.168.0.2 where I have RemoteDB. I reach it with no problem and works.

It is requesting to map the URI like this: http://localhost:2001/nahar

And then the "/Database"

This server can be reached from outside by a port routing. Where all the 2001 port traffic is routed to 2001 port on this server.

When access from outside it does works fine also.

But the client can be accessing the same server from private and from the public network. and that is a problem. Using the public URI do not resolve to the local server.

How can I use RemoteDB client in order to get this connection work? I belive I need to save a pair of URI one private another public. But how to quickly find and switch with RemoteDB client?

thanks

Eduardo
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2432
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 2014 at 9:39am
If I understood correclty, this is not a RemoteDB or Sparkle question, but more network-related. Sparkle (and RemoteDB which is based on Sparkle) doesn't care about the server address. Actually when you register a module using "http://localhost:2001/nahar", the server name is the only part discarded by Sparkle, because it serves no purpose (only scheme (http), port and path are important).
I'm not sure how you can access a local server from your internal network using a public address, I think it's not possible or require some specific configuration in your network. Worst case you could use some configuration file and change the server address at runtime.
Back to Top
Eduardo Elias View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 May 2014
Posts: 233
Post Options Post Options   Quote Eduardo Elias Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 2014 at 11:18am
No, this is not network related only...

I am using Aurelius + RemoteDB client. And when gets to the point of connect there are some trouble around this.

This will be a pretty common scenario for smartphones and tablets, and I am trying to find a solution and at same time it will benefit your product.

My question is how to detect and quickly switch between 2 possible URIs when using RemoteDB as client with Aurelius. 
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2432
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 2014 at 2:08pm
Hi Eduardo, I still don't understand. If you can programatically set the URI of your server address from Delphi code, what's the problem in changing the address from code?
Back to Top
Eduardo Elias View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 May 2014
Posts: 233
Post Options Post Options   Quote Eduardo Elias Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 2014 at 3:35pm
nevermind, in the process of explaining I found a solution.

The problem is to switch between 2 URI, the private and the public, because the user can be using the internal WIFI network (private) and outside using Internet.

And in my code it is some classes aways from the TRemoteDBConnectionAdapter.Create(FXDB, true) and the moment that Aurelius do connect. 

At that point is hard to come back. So I was wondering if there is any mechanism or event or whatever that could be used to switch URI without breaking the calling stack. Since it is not a real error, the fact is that  you dont know previously which URI to use first.

Got it?
Back to Top
Wagner R. Landgraf View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2432
Post Options Post Options   Quote Wagner R. Landgraf Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 2014 at 4:46pm
Kind of. What solution you found?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down