wowserhq / wowser

World of Warcraft in the browser using JavaScript and WebGL
MIT License
238 stars 63 forks source link

Fix remote and realm join #165

Closed Yehonal closed 3 years ago

Yehonal commented 8 years ago

This fixes connection when server is not in same host of wowser

removing localhost hardcoded inside and implementing port configuration.

Also sending correct opcode when realm is not 0

app.writeUnsignedInt(this.realm.id);

Yehonal commented 8 years ago

I've cleaned it

However about auth state, i don't remember why i needed to create that state... but there are only 2 possibilities:

1) i've not noticed the session.auth.host

2) session.auth.host is not the same of component state ( value inserted into text input ) . I've checked it reading the code, but seems that are the same values. I cannot test it now

However i've cleaned all the code and i think you can squash and merge if you want.

timkurvers commented 8 years ago

Had you been able to test whether the setState changes are required?

fallenoak commented 8 years ago

Since Wowser currently only runs in the browser, its ability to connect to a given host and port via TCP is limited to what's exposed by a Websockify proxy. See here: https://github.com/wowserhq/wowser#socket-proxies

While it would be lovely to support arbitrary hostname and port combinations, I'd imagine it'd make more sense to wait until either:

The latter approach might be most effective if we coupled Wowser proxy configuration with a modified Websockify proxy that allowed connecting to a whitelisted set of IPs and ports.

timkurvers commented 8 years ago

Great catch @fallenoak, had completely forgotten about that!

Yehonal commented 8 years ago

I'm using it with your proxy configured to handle this connection. I've tested in any kind of configurations: wowser and proxy on same host of server in a local context , wowser and proxy in remote on same host of server, wowser and proxy on remote or on local with server in another host. With chrome or firefox I've any kind of problem. This configuration is needed to allow to host wowser on remote and allowing people to connect without any proxy configured..with a small trick on server proxy.

If you explain me where is exaxtly the problem i can test it better

Il 01/Ago/2016 14:42, "Tim Kurvers" notifications@github.com ha scritto:

Great catch @fallenoak https://github.com/fallenoak, had completely forgotten about that!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wowserhq/wowser/pull/165#issuecomment-236569853, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI-lPrc5uCQPskabHltAjH6jZr3G0buks5qbemjgaJpZM4JV-4P .

fallenoak commented 8 years ago

@Yehonal Right, but if the auth server is returning some specific hostname and port number, and that hostname + port is actually running a Websockify proxy, how is the real World of Warcraft client still able to connect?

In the future, configurable proxy settings would allow for this-- but currently, I don't see a way to make it work.