B4J Library [B4X] jRDC2 - B4J implementation of RDC (Remote Database Connector)

Status
Not open for further replies.

Angel Garcia

Member
Licensed User
Hi All,
Maybe this is a silly question.
I'm using RDC on my project and works terrific on LAN (Same Wifi for PC/server and Android device) :).
Now I want to make it work on the internet.
I tried with port forwarding from the internet of my home with no success, i don't understand how to configure it correctly, been trying by trial and error. :(
I want to know if somebody already did this successfully?, and can put me in the right path, before moving to rent a VPS on the internet
Please help!
 

Angel Garcia

Member
Licensed User
You have specified a port in the configuration (not the one for the database) you have to share in the firewall.

Greetings
I set in the config file:
JdbcUrl=jdbc:mysql://localhost:3306/mydb
User=AndroEstilo
Password=**********
ServerPort=17174

In the Windows Firewall i created 2 rules:
Inbound for TCP port 17174
Outbound for TCP port 17174

Now in the router i added some port forwarding to 17174 but no connection triggers =(
 

Angel Garcia

Member
Licensed User
hmm, then it is not a problem of the RDC. Any other Firewall? Can you call it from the test link?
Yes, actually it in the browser i test:
http://127.0.0.1:17174/?method=test

And i got the correct answer:
RemoteServer is running (Wed Jan 03 20:05:54 CST 2018)
Connection successful.

I think is my port forwarding rule somehow, in the B4A Code i pass my public IP with the port: 187.XXX.XXX.XX:17174
I have in my port forwarding rule:

upload_2018-1-3_20-11-14.png


What am i doing wrong?
 

A Z M JANNAT UL KARIM

Member
Licensed User
Hi Angel, I had successfully forwarded port through Mikrotik Router with no issues :). You need to re-configure two steps if your apps run successfully in LAN
-> Configure in router - Forward the port. You need a Real IP. Test from the PC with URL Also try to avoid port 80 and 8080 as it generally use for router configuration page. You can use other port if you like ...
--> Configure in Apps - Change the connection string to Real IP from Local IP.

Have a nice day :)
 

Angel Garcia

Member
Licensed User
Configure in router - Forward the port. You need a Real IP. Test from the PC with URL Also try to avoid port 80 and 8080 as it generally use for router configuration page. You can use other port if you like ...
I think this is where im failing, :( how i get a real IP?, i just know my public IP: 187.XXX.XXX.XX, and my LAN IP: 192.168.100.12

-> Configure in Apps - Change the connection string to Read IP from Local IP.
How i change mi connection string?, on my B4A code the connection string is : http://187.XXX.XXX.XX:17174, It is my public IP with the open port


Hi Angel, which port you are forwarding here in router. In External Port I see that you selected 80. Then your URL should be
http://187.XXX.XXX.XX:80/?method=test instead of 187.XXX.XXX.XX:17174. It's the matter for forwarding port on router, not from your pc if you try to access from outside world. Thanks
Ok let me try it
 

Angel Garcia

Member
Licensed User
After some reading i found this:
upload_2018-1-3_21-51-21.png


Is the port restricted involved?
upload_2018-1-3_21-53-37.png


This is what i need to change?
Is someone facing the same issue?
@karim, you have this configuration on your router?
To everyone thanks for your help.
Regards
 

A Z M JANNAT UL KARIM

Member
Licensed User
Hi Angel, seems to be you are not using Real IP. So what I think you can't access the server from outside without Real IP. You can talk with your ISP to give you a Real IP or they can forward a port for your router through which you can connect :)
 

Angel Garcia

Member
Licensed User
Hi Angel, seems to be you are not using Real IP. So what I think you can't access the server from outside without Real IP. You can talk with your ISP to give you a Real IP or they can forward a port for your router through which you can connect
Ok, i'll make a few phone calls. I'll keep you guys updated.
Thanks all for your help
 

Angel Garcia

Member
Licensed User
Hi All,
Finally you guys were right, my IPS was blocking ports.
After i rented a VPS, installed everything and it worked great with the public IP the provided me.
My IPS su%$&
Thanks all for your help!
 
Status
Not open for further replies.
Top