Used as an alternative to large and deferred data transfer from clients and servers when dealing with large data that requires net.* splitting.
This initially was an experiment to see if we can use HTTP as a form of deferred networking, while not requiring any form of external communication outside the process.
Courtesy of Buildstruct for allowing me to reliably test this under their player-base.
This does not work on single-player/localhost, due to the fact HTTP is blocked from accessing localhost.
Do note that this does open ports & accepts HTTP requests, we recommend configuring this behind mitigation services such as Cloudflare.
You can find the binary here: https://github.com/eprosync/interstellar_gmod
This is just a simple list of pros/cons, there are alternatives that do not require interstellar such as gm_express, however it is to be note that in the future a similar API for this could be strictly made without using interstellar.
+ Deferred handling of incoming data, only aligned with source-engine's thread during lua execution.
+ Able to send large amounts of data greater than net 64 KB limit.
+ Endpoints are dynamically generated & unique per-player.
+ Server authoritive networking, requires server acknowledgement before serving.
- Susceptible to Denial of Service if not setup correctly.
- Not aligned with source-engine reliable data, may arrive later than sooner.
- Possible timeouts during window of receiving.
- Each server must have a unique extra port opened.interserve_address [string]- Client's inverserve address or domain (format IP [no port] or domain)interserve_iport [number]- Server's interserve port (must be a valid port!)interserve_port [number]- Client's inverserve port (must be the same or targeting a proxy)interserve_ssl [boolean]- Client's inverserve SSL supportinterserve_trusted [boolean]- Client's inverserve trusted proxy supportinterserve_timeout [number]- Server's interserve timeout in secondsinterserve_size [number]- Server's interserve max internal upload size
I recommend that on each server instance inside server.cfg you set the interserve_iport.
By default it targets 25500 which if you are using multiple instances will stop other server instances from attaching to the port if already in-use.
- Adds a new interserve endpoint, cannot use interserve without registering an endpoint.
- Only available on server realms.
- Removes an existing interserve endpoint.
- Only available on server realms.
- Checks if an interserve endpoint has been registered.
- Only available on server realms.
- A callback for incoming data.
- callback: function(data: string, invoker?: Player)
- For sending data to the server or client through interserve.
- invoker: the target player, only available on server realms.
- For sending data to all players on the server through interserve.
- Only available on server realms.
- For sending data to players with an exclusion on the server through interserve.
- Only available on server realms.
- A callback for when failures are captured under interserve.
- callback: function(code: number, reason: string, headers?: {[index: string]: string})
- Only available on client realms.
- A callback for confirmations to uploads and downloads during threaded processing.
- Returning false in the callback will stop the process from continuing to receivers.
- callback: function(invoker: Player, req: iot.serve.request): boolean?
- Only available on server realms.
- A callback for handshake confirmations to upload to the server
- Returning false in the callback will stop the upload process from continuing to interrupt.
- callback: function(invoker: Player, size: number): boolean?
- Only available on server realms.
Add further endpoint obfuscation by using salt'ed MD5/SHA on startup.- Built-in logger and profiler for endpoint monitoring.
Other additions to this depends on interstellar, and if I can implement it reliably.