Skip to content

A new version of engine.io (socket.io) wrapper based on netty.

License

Notifications You must be signed in to change notification settings

Apisium/netty-engine.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

netty-engine.io

A new version of engine.io wrapper based on netty.

Usage

Add repository:

repositories {
    maven {
        name 'jitpack'
        url 'https://www.jitpack.io'
    }
}

The add dependencies:

dependencies {
    implementation 'com.github.Apisium:netty-engine.io:1.1'
    implementation 'io.netty:netty-all:4.1.85.Final'
    implementation 'io.socket:engine.io-server:6.2.1'
    testImplementation ('io.socket:socket.io-server:4.0.1') {
        exclude group: 'io.socket', module: 'engine.io-server' // Avoid old engine.io
    }
}

Example

Full example

import cn.apisium.netty.engineio.EngineIoHandler;
import io.socket.engineio.server.EngineIoServer;
import io.socket.socketio.server.SocketIoServer;

public class Main {
    public static void main(String[] args) {
        EngineIoServer engineIoServer = new EngineIoServer();
        SocketIoServer socketIoServer = new SocketIoServer(engineIoServer);
        
        Channel ch; // ch = ctx.channel();
        ch.pipeline().addLast(new EngineIoHandler(engineIoServer));
    }
}

Author

Shirasawa

License

MIT