The TrafficLight project is a comprehensive tool for managing and directing internet traffic, similar to Keitaro. It allows for the routing of traffic based on various criteria, such as IP addresses, geolocation, and device type. The project offers extensive capabilities for analyzing and optimizing data flows.
To download and start the TrafficLight project, as well as configure it using pm2
or Docker Compose
, follow these instructions.
- Clone the repository using the command:
git clone https://github.com/Wireforce-LLC/trafficlight.git
For long-term operation of the project in the background, use PM2, a process manager for Node.js.
- If PM2 is not yet installed, install it globally using npm:
npm install pm2 -g
- Start the TrafficLight project with PM2:
pm2 start hello.js --name trafficlight
- To automatically start your application after a reboot with PM2, use:
pm2 startup
- To save the settings of the processes running through PM2 so that they automatically restart after system reboot, execute the command:
pm2 save
If you prefer containerization, you can run TrafficLight using Docker Compose.
- Start the project with the command:
docker-compose up -d
The -d
key will run your container in the background.
The configuration is divided into several key sections: meta
, if
, then
, and else
. Each section performs a unique role in determining how traffic is routed based on the defined conditions.
meta:
group: Group Name
noindex: false
if:
tools: []
then:
type: JSON
data:
raw:
...
else:
type: JSON
data:
raw:
...
The project consists of several key components and modules:
hello.js
— the entry point of the project, responsible for initializing and launching the traffic light simulation.- Modules for processing HTTP requests, including the
Router
module for routing andHttp
for working with HTTP responses. - A filtering system for managing traffic based on IP addresses and other request parameters.
- Auxiliary utilities and configuration files.