Pomax / socketless

A framework and methodology for writing web socket RPC programs, without writing a single line of web socket or RPC code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a pass-through proxy

Pomax opened this issue · comments

commented

Ideally, "the user" is not the same as "the client", because if the user's on a spotty connection, we don't want the client to disconnect from the server. As such, writing "the client" as a proxy that sits between the user's browser, and the actual game server, makes a hell of a lot of sense but requires that there is a mechanism for proxying all the calls, so that the user thinks it's talking to the server, and the server thinks it's talking to users, with the client sitting in between the two to make sure that if the user disconnects for whatever reason, nothing breaks and the user can simply reconnect to the client.

This also requires some extra functions for ensuring that reconnections by the user come with the client sending that user all the data necessary for it to bootstrap itself.

commented

Effectively this requires having an agent that acts both as client-to-the-main-server, as well as acting as its own server for browser access... so the proxy needs to ClientServer.createClient() to the server and ClientServer.createServer() for accepting a single connection.

Given the 0.6 rewrite based on client/server class passing, we're looking at building a ClientServer.createProxy(serverURL)

commented

Rather than a proxy, this should be a createWebClient function, creating a client that connects the server (nothing new there) and also runs its own web+socket server with autogenerated code so that loading up the web server in the browser automatically transparently puts the browser in touch with the server, through the client.

It's still a proxy, but it's a very specific kind of proxy.

commented

This has been done in the create-web-client branch, which will be merged into master after a game demo has been completed and the README.md has been updated accordingly