MENU: HOME · SERVER · APPLICATION · CONSOLE
Video Tutorials ( HD )
Follow Updates @socketbug_dev
Support & Feature Requests
Socketbug is licensed under the LGPL v3 license.
Then you can follow along below ;)
Please Note: We are assuming with the following instructions, that you want to build a local copy of the Socketbug Server. If this is the case, then we are also going to assume that you have working knowledge of how to use git. Git will be used for almost every part of setting up the Socketbug server. If you need more information on how to use git, please check out the following sites for your Operating System:
FOLLOW ORIGINAL INSTRUCTIONS FOUND HERE, OR…
We preferred the following setup for our Linux installation:
First, change to a temp directory where you can download the source code for building. We like /usr/local/src as it is available on most Unix based machines. So lets make a temp folder here:
cd /usr/local/src
sudo mkdir /usr/local/src/socketbug
sudo chmod 777 /usr/local/src/socketbug
cd /usr/local/src/socketbug
Now that we are in the temp folder, download and install Node.js
git clone --depth 1 https://github.com/joyent/node.git
cd node
git checkout origin/v0.4
export JOBS=2
sudo ./configure --prefix=/usr/local
sudo make
sudo make install
Then Install the Node.js Package Manager (NPM):
curl http://npmjs.org/install.sh | sudo sh
Let’s verify that everything was installed correctly before removing the Node.js source code folder. Run the following commands to verify the installations were successful:
which node
This should return a path to where Node.js is installed. If it returns nothing, then Node.js was not installed correctly. Now verify the NPM installed correctly:
which npm
This should also return a path to where NPM is installed. If it returns nothing, then NPM was not installed correctly.
Once you have verified that everything is installed correctly, you can remove the source code we downloaded to install everything:
cd /usr/local/src/socketbug
sudo rm -fr /usr/local/src/socketbug/node
Pick a place on your server where you want to install the Socketbug Server. For this writeup, we will use /usr/local/socketbug. You can use whatever directory you wish.
sudo mkdir /usr/local/socketbug/
sudo chmod 777 /usr/local/socketbug
For the Socketbug Server, we really only need a few files, so let’s change back to our temp directory before downloading Socketbug.
cd /usr/local/src/socketbug
If are using git, you can just run the following command from the directory you already setup for Socketbug:
git clone https://github.com/manifestinteractive/socketbug.git .
Notice the ‘.’ at the end of the git command. This will check it out in your current directory, rather than creating a new directory for you.
Now you can copy the server files over into where you will run your Socketbug server.
cp -R /usr/local/src/socketbug/server/* /usr/local/socketbug
If you are going to use Socketbug as a service, you will need to set permissions to the log folder:
sudo chmod 777 /usr/local/socketbug/logs
Change into the Socketbug Server directory
cd /usr/local/socketbug
While still in the /usr/local/socketbug directory, run the following commands
Install Node.js Package socket.io:
sudo npm install socket.io
Install Node.js Package forever ( to run Socketbug as a service ):
sudo npm install forever -g
You will need this if you want to use our bash scripts.
Before you can start Socketbug you will need to open the server file and make a few changes:
nano socketbug_server.js
Look for var _socketbug
to find the configuration variable for the Socketbug Server.
_socketbug._config._server_port
( Number ): 8080
This is your Socketbug Server Port Number Where Socket.IO is Running
_socketbug._config._authorized_only._groups
( Boolean ): true
Should Group Authentication Be Required? If this is set to true then all connections will have their Group ID authenticated on whatever server you specify below
_socketbug._config._authorized_only._applications
( Boolean ): true
Should Application Authentication Be Required? If this is set to true then all connections will have their Application ID authenticated on whatever server you specify below
_socketbug._config._authorize._host
( String ): www.mywebsite.com
Host URL ( NOTE: do not add http:// or a trailing / ) to Authentication Script. This can be any server. It does not have to be on the same server that Socketbug is installed on.
_socketbug._config._authorize._port
( Number ): 80
Port Number for your Authentication Script
_socketbug._config._authorize._path
( String ): /path/to/my/auth.script
Path from root of Authentication Script. Basically, this gets appended to socketbug.config.authorize.host to make a complete URL. ( NOTE: This should start with a / )
_socketbug._config._encryption_salt
( String ): Go0dp4$sW0rd
SALT you would like to use for MD5 Hashing. This is the SAME SALT you will use throughout your Socketbug Communications.
_socketbug._groups
( Object )
Object to Store Socketbug Groups. You will not need to mess with this, it’s just for storing connection info on Socketbug.
_socketbug._applications
( Object )
Object to Store Socketbug Applications. You will not need to mess with this, it’s just for storing connection info on Socketbug.
_socketbug._clients
( Object )
Object to Store Socketbug Clients. You will not need to mess with this, it’s just for storing connection info on Socketbug.
If you would prefer to just run Socketbug in your Terminal Window and not as a Service:
node socketbug_server.js
If you would like to run it as a service, you can just use the supplied BASH files in the Socketbug Server directory.
socketbug_start
Double Click to START the Socketbug Server as a Service ( assuming you installed the Forever Node.js Package )
socketbug_stop
Double Click to STOP the Socketbug Server as a Service ( assuming you installed the Forever Node.js Package )
socketbug_restart
Double Click to RESTART the Socketbug Server as a Service ( assuming you installed the Forever Node.js Package )