View Single Post
Author Message
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-02-2015 , 13:14   HTTP Server w/ RCon Multiplexer
Reply With Quote #1

This is something I was working on a while ago but never got around to releasing because it just needed That One Last Thing™.
Rather than leave it sitting around for the next forever while that doesn't happen, here it is!
This release consists of 2 extensions and a handful of partially-completed sample plugins.
Links can be found at the bottom of this post.

Extensions

Conplex
Conplex exposes an interface (both C++ and SourcePawn) to multiplex connections onto the game server's existing RCon socket.

Conplex is engine-independent but requires a small amount of easy-to-find gamedata.
Gamedata is currently provided for TF2, CS:S, and CS:GO.

Conplex includes a couple of protections against attacks to support exposing the RCon socket publicly:
  • Connections that send data that is not matched to a registered protocol are closed and treated as a failed RCon auth (which can cause the sending IP to be banned).
    This prevents a class of attacks that involve sending invalid data to the RCon socket.
  • Connections that do not send enough data to match to a known protocol are closed after a short timeout.
    This prevents a class of attacks that involves opening numerous connections and never closing them.

Webcon
Webcon provides a HTTP server on the RCon port using Conplex.
Specifically, this allows the game server's regular connect address to be visited in a web browser.

Webcon is engine-independent and requires no gamedata, just Conplex.

A rich SourcePawn interface is exposed to allow plugins to handle requests and serve both dynamic and static content.
The include file and test plugin (and of course the samples below) should be perused for developer usage information.

The ultimate goal is web-based SourceMod configuration and management that can even be used by people hosting with a GSP.

Sample Plugins

Scoreboard
A real-time web-based scoreboard. Screenshot.
Made for and styled after TF2, but should work for any game.
Browser support was not a concern, so probably only looks correct in Chrome.

Web Manager
A very incomplete sample showing Steam OpenID login and session persistence.
Ideally these functions would be in a reusable library plugin (along with other stuff like HTML escaping).

IRC Server
Sample for Conplex implementing a basic IRC server.

Download

Source Code
Issue Tracker


Please note that none of the sample plugins come compiled, as only the Scoreboard plugin is designed for actual use rather than just a code example.

Build Status
__________________

Last edited by asherkin; 02-03-2018 at 20:38.
asherkin is offline