Recent

Author Topic: Korg Remote Desktop  (Read 9553 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #45 on: November 21, 2020, 12:35:32 pm »
Sorry and you for your testing, how did you know the port of client A and port of client B if they were behind the NAT? How did you deduce them?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #46 on: November 21, 2020, 01:32:22 pm »
how did you know the port of client A and port of client B if they were behind the NAT? How did you deduce them?
That part was not in the test-program (and also wasn't in the python example). It just only shows the technique of punching an UDP hole (which worked). I just picked a random port (and because I started both programs, this wasn't a problem). Both were behind a NAT without forwarded ports so the hole punching is proven with that.

The protocol to know which port A and B are really using for messaging is done via the publicly accessible controller.
You already have most of that in your own code.

A does a login with C (controller) and passes it's controllerport (1891 or something else).
B does the same.

You now have that both need to click P2P.
Both A and B send a message to C so the external messaging port gets put in a table (maybe that external messaging port is always the same as internal. For me it was but you might still want to use that getremotesport for it).

Now both messaging ports of A and B end up in a table on C.
Then both A and B can get each others IP and messaging port from C and use that to start punching the whole.

I hope I explained this all clearly. Otherwise just let me know.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #47 on: November 21, 2020, 03:24:23 pm »
I changed the code as you told me. But it still doesn't work.

PS: I also made a small change. Now on one of the two clients when you press reverse it blocks the field where to put the remote session. Then when you press P2P on the opposite client to start the connection automatically on both.

Test the attachments
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #48 on: November 21, 2020, 03:40:10 pm »
Are you testing with 3 different networks?

If not... Are the two clients on the same network?
Is so... Does your router support nat loopback?
 (I.e. You can reach your own router through you external ip?)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #49 on: November 21, 2020, 03:42:12 pm »
I use the home network for a client

I use the cell phone hotspot for each other

Both connect correctly to the controller. In fact they get the ID correctly. But the data exchange between the two clients does not take place. :(
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #50 on: November 21, 2020, 03:51:53 pm »
Both connect correctly to the controller. In fact they get the ID correctly. But the data exchange between the two clients does not take place. :(
Did it work work my example app?

If so, you need to build in logging to see if you get at the step that both clients are sending messages to each others ports. My guess is that that doesn't happen.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #51 on: November 21, 2020, 03:54:58 pm »
Your example only worked between one client behind nat and the other not. Otherwise I didn't know which ports they used publicly. This is why I have incorporated your example into mine. I hand him the data taken from the controller. But to me it doesn't work through two clients on two different nats. Can you get my latest example to work?

Know that I really appreciate the help you give me
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #52 on: November 21, 2020, 04:07:53 pm »
Your example only worked between one client behind nat and the other not. Otherwise I didn't know which ports they used publicly.
Then maybe one if the nats translates the internal port to another external one.

If you send a message on the message port of both clients to the controller, what getremoteport gives the controller for those clients?

Did you also try both the same ports for both clients? (Both 4000?)

For me it worked with both clients behind a nat.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #53 on: November 22, 2020, 06:26:56 pm »
I changed the source again. Now you can use the code you wrote yourself to do the test through the "Manual test" button. To make the "Manual test" work just set "Message local port" for the port number you are listening on and "Controller port" and "Controller IP" with the data of the remote host. Can you tell me if it works for you through the two NATs? Because it works for me in LAN but not behind the two NATs.

thanks a lot
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #54 on: November 22, 2020, 07:57:38 pm »
I changed the source again. Now you can use the code you wrote yourself to do the test through the "Manual test" button. To make the "Manual test" work just set "Message local port" for the port number you are listening on and "Controller port" and "Controller IP" with the data of the remote host. Can you tell me if it works for you through the two NATs? Because it works for me in LAN but not behind the two NATs.
I only took the client project1.exe and started it at both ends (both their own NAT).
(there is no need for the controller if we know the IPs and Ports.

Filled in IP of A and 7777 as controller IP and port on B and message port 7777.
Filled in IP of B and 7777 as controller IP and port on A and message port 7777.
Pressed Manual test on both sides.
And pretty quick I got the WE HAVE CONTACT on both sides.
So for me the UDP hole punching worked.

Using different ports at both ends work too.
Filled in IP of A and 4000 as controller IP and port on B and message port 7777.
Filled in IP of B and 7777 as controller IP and port on A and message port 4000.
Pressed Manual test on both sides.
And again I got the WE HAVE CONTACT on both sides.

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #55 on: November 22, 2020, 09:26:52 pm »
But did you do it with my latest program that I attached to you?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #56 on: November 22, 2020, 09:52:49 pm »
But did you do it with my latest program that I attached to you?
Yep (that's the only one with the "Manual test" button).
And I only used the client_controller_test.zip (client version) because for manual testing there is no need for controller.

I do need to say that my UDP port does not get translated by the NAT.
When I check the controller software... the getRemotePort for the client (both controllerport and messagingport) are the same as outgoing.

If you say that connecting out with UDP 1900 gives you a getRemotePort of 1901 on the controller side, then things (i.e. NAT) might be different.

(wat kind of router/modem do you have on both sides?)

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #57 on: November 22, 2020, 10:34:32 pm »
I have a Vodafone station Revolution on the nat at home and on the other a hot spot made with an Android phone. Could you please also do a test going through the controller? to see if it works?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

rvk

  • Hero Member
  • *****
  • Posts: 6594
Re: Korg Remote Desktop
« Reply #58 on: November 22, 2020, 11:21:05 pm »
Could you please also do a test going through the controller? to see if it works?
That'll be tomorrow. Everything already shut down for today  ::)

Problem is also that I only have regularly access to 2 NAT networks, not 3.
And I'm not sure it works the same if both clients are on the same network.
I can check out if it works correctly with the loopback address.

Are your external remote controlports different from the internal ones when connecting to the controller?

xinyiman

  • Hero Member
  • *****
  • Posts: 2256
    • Lazarus and Free Pascal italian community
Re: Korg Remote Desktop
« Reply #59 on: November 23, 2020, 08:20:31 am »
I don't care if it works with loopback for now. To me it is enough that the two clients are behind two different nats and the controller reachable from public ip. Yes to me it changes the doors on the public.

Thanks
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

 

TinyPortal © 2005-2018