Which Protocols are Supported by Workerman

Workerman supports various protocols at the interface level, as long as they conform to the ConnectionInterface (refer to the custom communication protocol section).

To facilitate developers, Workerman provides HTTP protocol, WebSocket protocol, as well as very simple Text protocol and frame protocol that can be used for binary transmission. Developers can directly use these protocols without the need for further development. If none of these protocols meet their needs, developers can refer to the custom protocol section to implement their own protocol.

Developers can also directly base on tcp or udp protocols.

Protocol Usage Example

// http protocol
$worker1 = new Worker('http://0.0.0.0:1221');
// websocket protocol
$worker2 = new Worker('websocket://0.0.0.0:1222');
// text protocol (telnet protocol)
$worker3 = new Worker('text://0.0.0.0:1223');
// frame protocol (can be used for binary transmission)
$worker3 = new Worker('frame://0.0.0.0:1223');
// directly based on tcp transmission
$worker4 = new Worker('tcp://0.0.0.0:1224');
// directly based on udp transmission
$worker5 = new Worker('udp://0.0.0.0:1225');