1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

Android Question Connecting App with jrdc2 without real ip through Internet, like TeamViewer or Anydesk

Discussion in 'Android Questions' started by A Z M JANNAT UL KARIM, Jul 22, 2019.

  1. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    I don't know whether it is the right place or I need to post it on Chit Chat.
    Hi, anyone think about the Subject? Just curious if it is possible. With some connectivity knowledge can it be done?

    Thank You :)
     
  2. DonManfred

    DonManfred Expert Licensed User

    jrdc2 and Teamviewer/Anydesk are not related at all.
    jrdc2 has nothing to do with Screensharing.
     
  3. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Yes, you are right. I am not referring to screen sharing here. I want to share service like jrdc2. Just let me explain more briefly. My client have different server on their end with same application. I want to build a general app to connect with their server. They don't have any real ip. In this scenario TV or AnyDesk they are connecting with each other through some tunneling concept with a static middle server controlled by them. What is the concept behind the scene is actually my thought. Whether it can be implemented here ...
     
  4. DonManfred

    DonManfred Expert Licensed User

    how can a jrdc2 server not have any IP? How are you connecting to it then?
     
  5. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    They have Local IP with local access. Without real IP and port forwarding it can not be accessed from outside. So port need to be forwarded through some way...
     
  6. DonManfred

    DonManfred Expert Licensed User

    it happens in the Router in this Network respectively it must be configured in the Router.

    This is something which must be setup correctly to access the jrdc2.
    Configure the router to forward the access to the correct machine running the jrdc2 and use the router wan ip then.
     
  7. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Okay. But now think about TeamViewer. Do we need to setup router for it?
     
  8. DonManfred

    DonManfred Expert Licensed User

    TEAMVIEWER is NOT related! It has his own system.
    For this the teamviewer and the server must speak together. It is some code in teamviewer AND the server which must communicate.
    There is no such think in jrdc2.

    Teamviewer starts a server on PC1 and PC2 is connecting to a tunnel which both, teamviewer and server is using.
    Again; there is no such thing in jrdc2 so nothing to communicate with.
     
  9. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Okay, so what TeamViewer doing is connecting with Server and forwarding some network port to create tunnel with PC2. So I need separate application to forward jrdc2 port to server. Thank you Don for pointing it. Now the thing is how? What is the general concept here for this tunneling?
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    A Z M JANNAT UL KARIM likes this.
  11. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Thank you Erel, let me try...
     
  12. DonManfred

    DonManfred Expert Licensed User

  13. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

    Thank you Erel for the post. I created a free DDNS there and tried the sample project, it worked :) Just a little more help please ...
    How to implement it with jrdc2. If I change the following code of jrdc2, should it worked ? Do I need to copy HttpUtils2Service module to jrdc2 project as I am not using the upload service. Do I need to do anything extra ?

    Code:
    Sub Process_Globals
        
    Private domain As String = "http://test.duckdns.org"
        
    Private token As String = "xxx"
        
    Private updateIp As Timer

        
    Public srvr As Server
        
    Public rdcConnector1 As RDCConnector
        
    Public const VERSION As Float = 2.22
        
    Type DBCommand (Name As String, Parameters() As Object)
        
    Type DBResult (Tag As Object, Columns As Map, Rows As List)
    End Sub

    Sub AppStart (Args() As String)
        updateIp.Initialize(
    "updateIp"10 * 60 * 1000'10 minutes
        updateIp.Enabled = True
        UpdateIp_Tick

        srvr.Initialize(
    "")
        rdcConnector1.Initialize
        srvr.Port = rdcConnector1.serverPort
        srvr.AddHandler(
    "/test""TestHandler"False)
        srvr.AddHandler(
    "/rdc""RDCHandler"False)
        srvr.Start
        
    Log($"jRDC is running (version = $1.2{VERSION})"$)
        StartMessageLoop
    End Sub

    Sub UpdateIp_Tick
        
    Dim j As HttpJob
        j.Initialize(
    "j", Me)
        j.Download2(
    "http://www.duckdns.org/update"Array As String("domains", domain, "token", token, _
            
    "ip"""))
    End Sub

    Sub JobDone (j As HttpJob)
        
    If j.Success = True Then
            
    Log("Update DuckDNS: " & j.GetString)
        
    Else
            
    Log("Error updating Duck DNS: " & j.ErrorMessage)
        
    End If
        j.Release
    End Sub
     
    fredo likes this.
  14. Erel

    Erel Administrator Staff Member Licensed User

    No. Use jOkHttpUtils2 library if needed.

    jRDC2 is a standard jServer solution. You can add any code you need.
     
    A Z M JANNAT UL KARIM likes this.
  15. A Z M JANNAT UL KARIM

    A Z M JANNAT UL KARIM Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice