I am trying to connect with the SocketIO, but I got this error from the Android side (iOS works):

Here is what I am doing in the Android:
override fun init() = callbackFlow {
val accessToken = tokenStorage.accessToken ?: return@callbackFlow
val option = IO.Options.builder()
.setUpgrade(false)
.setTransports(arrayOf(WebSocket.NAME))
.setExtraHeaders(mapOf("Authorization" to listOf("Bearer ".plus(accessToken)))) // Without this I'll the the Unauthorized 401
.build()
socket = IO.socket(BuildConfig.WS_URL, option)
socket.on(Socket.EVENT_CONNECT) {
trySend(true)
}
socket.on(Socket.EVENT_CONNECT_ERROR) {
Log.d("xxxx", "asSocketPayload error: ${it[0]}")
}
socket.on(DEFAULT_EVENT) {
it[0].asSocketPayload()
}
socket.connect()
awaitClose {
socket.disconnect()
}
}
I am using the socket IO client 2.0.0
Thanks