A websocket module for Garry's Mod
You have two options:
- Download the compiled module in this repo, should work for most linux machines running 32 bit srcds
- Build it yourself
Currently you should build the module yourself, since the current release doesn't clean up listener threads after lua GC's the websocket instance.
- Click on
gmsv_gwebsocket_linux.dll
above - Click on the download button
- Stick it in your servers
lua/bin
folder, if the folder doesnt exist, create it.
This project uses premake5 to generate makefiles and currently only supports 32 bit linux builds
- If you are on a 64 bit system, make sure your compiler is setup for crosscompiling to 32 bit. If you use GCC/G++, install the
gcc-multilib
andg++-multilib
packages with your favorite package manager. - Clone the repository
git clone --recurse-submodules https://github.com/norrbotten/gwebsocket.git
- Run the
setup_linux.sh
script. It will download and build all dependencies. - Generate makefiles
premake5 gmake2
- Make the module
cd build && make -j config=release && cd ..
- Your ready to use module is now in
build/module/bin
. Copy it to yourlua/bin
folder.
IXWebSocket needs to be built for 32 bit and installed, for this you will additionally need 32 bit builds of OpenSSL and ZLib. Assuming you're on linux, these can be automatically downloaded and built using the provided script.
- Require it in your script
require("gwebsocket")
- This sets a global variable called
gwebsocket
, so don't overwrite it (blame garry for no returns from require) - See the examples. Since i actually now have a reason to not abandon this project, usage is subject to change.