Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use with KTOR #542

Open
RobertMenke opened this issue Apr 14, 2018 · 1 comment
Open

Use with KTOR #542

RobertMenke opened this issue Apr 14, 2018 · 1 comment

Comments

@RobertMenke
Copy link

Hey there, thank you for all of your hard work on this library. I just have a quick question. I'm evaluating ktor as a framework and have set up a sample project using netty as a server.

I have a very basic connection setup as follows:

class SecureSocketServer {

    private val config = getConfiguration()
    private val server = SocketIOServer(config)

    fun start() {
        server.start()
    }

    fun <T>addEvent(eventName : String, serializeTo : Class<T>, listener : DataListener<T>) {
        server.addEventListener(eventName, serializeTo, listener)
    }

    private fun getConfiguration() : Configuration {
        val config = Configuration()
        config.hostname = "localhost"
        config.port = 8443
        config.pingTimeout = 60
        config.pingInterval = 60
        config.keyStorePassword = "testing"
        config.keyStore = SecureSocketServer::class.java.getResourceAsStream("/jks/selfsigned.jks")

        return config
    }
}

When starting the server I get what seems to be a success message INFO c.c.socketio.SocketIOServer - SocketIO server started at port: 8443, but my web socket.io-client (1.7.4) and android socket.io client io.socket:socket.io-client:0.8.3 are unable to connect. In both cases, the connections are refused.

I've also set up samples with using ktor's standard socket library and have been able to successfully connect with both the web and android's standard websocket libraries.

Could there be an incompatibility with ktor, or is my configuration incorrect?

@ghost
Copy link

ghost commented Apr 23, 2023

Found any way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant