does renet work on real remote servers? deployment on ec2 doesn't work, maybe a bug? #52
-
Hi, sorry for the annoying beginner question, but I've been stuck on this for a couple days and I'm not making any progress... I'm trying to get the renet echo example to work on ec2. I've verified that my ports are opened correctly and that I'm able to connect to my remote instance via UDP by following the instructions here: https://serverfault.com/a/678635. I thought that I'd just need to change the server from binding to localhost to an unspecified addess (i.e. bind the server to Here's a gist of what I tried: https://gist.github.com/bcolloran/f499cfffcce3d8346f281a463934ef6a When I start the process on the server with e.g.
Any suggestions about what I might be doing wrong? Thanks so much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I've been continuing to play with this for a few days, and I think there might be an issue with how renet binds to ports or connects to remote machines. I've been able to get the Tokio echo udp example (client, server) working on ec2 without any issue by binding both the client and server to client command: server: This works without any issues, successfully echoing input from the client to the server and back. My gist from the post above takes the same approach: it binds sockets to |
Beta Was this translation helpful? Give feedback.
Hey, sorry about the late reply
The problem seems to be at this line: https://gist.github.com/bcolloran/f499cfffcce3d8346f281a463934ef6a#file-echo_ec2-rs-L66
When creating the ServerConfig the server_address given to it must be the public address that the client will communicate to the server. So you can bind the socket to
0.0.0.0:0
, but you need to pass to this configuration the public address of the ec2 machine with the used port.Edit: make sure you have port forwarding and the firewall (if the machine has one) working correctly. This is a common problem.