0 votes

Hi,

I am running a server.pck as a Godot Server on my GCP VM instance.

var server = WebSocketServer.new()
server.listen(port)

I am running a seperate client.html currently from my local machine, attempting to connect to:

var client = WebSocketClient.new()
var url = "ws://" + ip + ":" + str(port)
print("attempting to connect to " + url)
client.connect_to_url(url)

The IP specified when trying to connect is the external IP of the GCP instance.

This all works using "localhost", but doesn't when using GCP. Do I need to do anything else to run a WebSocketServer through GCP?

Using "netstat -ano | grep 4444" I get:

 tcp6       0      0 :::4444    :::*     LISTEN      off (0.00/0/0)

Thanks.

Godot version latest
in Engine by (12 points)

1 Answer

0 votes
  1. Configure instance firewall to allow incoming on port 4444
  2. Configure account wide rules to allow incoming connections to GCP VM instance.

I do not use Google cloud, but I used Oracle's free tier for thing's like this

For Oracle cloud, this will be the following:
1. Install firewalld (Oracle custom kernel do not work with ufw)
2. Use fiewalld cli to open ports.
3 In account dashboard create Internet Gateway connected to Virtual Cloud Network instance is on. (Virtual Cloud Network created for you. Virtual Cloud Network you must create yourself to allow external access to instances on Virtual Cloud Network)

by (889 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.