Monthly Target: $400 Donations: $124
 31% 

HTTP Server w/ RCon Multiplexer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-02-2015 , 14: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
__________________
asherkin is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 09-02-2015 , 14:21   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #2

Excellent work! I love those "That One Last Thing™'s".

Server usage just got more interesting.
__________________

Fragworks.net - We frag, so you don't have to.
Maxximou5 is offline
redwerewolf
r3dw3r3w0lf
Join Date: Sep 2009
Old 09-02-2015 , 15:46   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #3

Oh my god, I can use this for the store system... you are awesome!
__________________
I no longer do Sourcemod commissions, don't message me please.
redwerewolf is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 09-02-2015 , 15:51   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #4

Just saw this in your signature. Does the scoreboard thing work for the MvM scoreboard or is it (as it usually is) the pvp board only?
Potato Uno is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-02-2015 , 16:03   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #5

Quote:
Originally Posted by Potato Uno View Post
Just saw this in your signature. Does the scoreboard thing work for the MvM scoreboard or is it (as it usually is) the pvp board only?
It's a basic clone of the regular scoreboard, you get what you see in the screenshot.
__________________
asherkin is offline
Powerlord
Oh Ross.
Join Date: Jun 2008
Location: Seduce Me!
Old 09-02-2015 , 17:23   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #6

...granted, the data exists in other entities to give you the MvM score counts. Or at least it should, probably in the tf_objective entity.
__________________
So long and thanks for all the fish.
Powerlord is offline
Sarabveer
Veteran Member
Join Date: Feb 2014
Location: NJ, United States
Old 09-03-2015 , 09:46   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #7

I wonder how many people are going to use this exposed to the public, they should at least put it behind a real webserver such as nginx or Apache.

+1 For a PHP Extension for this!
__________________

Last edited by Sarabveer; 09-03-2015 at 10:28.
Sarabveer is offline
Send a message via Skype™ to Sarabveer
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 09-03-2015 , 10:16   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #8

pretty cool, thanks for this. i wanted to multiplex the rcon port for a websocket server for like forever already but didnt have the time
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 09-03-2015 at 10:19.
Zephyrus is offline
Razmo51
Senior Member
Join Date: Aug 2011
Location: Event "player_death
Old 09-03-2015 , 13:39   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #9

Got this error on Linux:

Quote:
sm exts load webcon
[SM] Extension webcon.ext.so failed to load: /..../csgo/addons/sourcemod/extensions/webcon.ext.so: undefined symbol: clock_gettime
CSGO server
__________________
Sorry for my bad English, I'm Belgian
Razmo51 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 09-03-2015 , 13:51   Re: HTTP Server w/ RCon Multiplexer
Reply With Quote #10

Quote:
Originally Posted by Razmo51 View Post
Got this error on Linux:

CSGO server
Try now.
__________________
asherkin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:18.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode