Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebSocket connection address is hard coded to 127.0.0.1 #24

Open
mneilly opened this issue Mar 23, 2022 · 0 comments
Open

WebSocket connection address is hard coded to 127.0.0.1 #24

mneilly opened this issue Mar 23, 2022 · 0 comments

Comments

@mneilly
Copy link

mneilly commented Mar 23, 2022

Using nakama-rs master branch to connect to a Nakama server on a remote host fails to connect because it is trying to connect to localhost instead.

2022-03-22T23:38:51.215471Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1050", vendor:
screteGpu, backend: Vulkan }
2022-03-22T23:38:52.263251Z INFO qws: Queuing connection to ws://127.0.0.1:7350/ws?lang=en&status=true&token=e
eyJ1aWQiOiI1Mjg5ZTUzYy0wYjBjLTQ5OWQtYTc3Ni1mNzdmODMxMzBlNDkiLCJ1c24iOiJyamFNWWlTb1ZuIiwiZXhwIjoxNjQ4NTk3MTMyfQ.
NXNXa1k
2022-03-22T23:38:52.279627Z ERROR nakama_rs::web_socket: on_received: WebSocketError(WS Error <Io(Os { code: 11
"Connection refused" })>)

It appears that the localhost address is hardcoded in web_socket.rs here:

nakama-rs/src/web_socket.rs

Lines 708 to 710 in 3874d9b

async fn connect(&self, session: &Session, appear_online: bool, connect_timeout: i32) {
let ws_url = "ws://127.0.0.1";
let port = 7350;

Modifying the code directly to use the address of my remote results in a connection.

2022-03-22T23:43:43.510475Z INFO qws: Queuing connection to ws://192.168.1.124:7350/ws?lang=en&status=true&tokCJ9.eyJ1aWQiOiI1Mjg5ZTUzYy0wYjBjLTQ5OWQtYTc3Ni1mNzdmODMxMzBlNDkiLCJ1c24iOiJyamFNWWlTb1ZuIiwiZXhwIjoxNjQ4NTk3NDIqR6ovlmgr_s
Sending "{"cid":"1","matchmaker_add":{"min_count":2,"max_count":2,"query":"*","string_properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant