Scarlet
Scarlet copied to clipboard
Can't add any header to request of SocketIO client
I use your great library for SocketIO connection https://github.com/Tinder/Scarlet/tree/0.2.x, but I have some troubles with adding a header to Request via OkHttpClient.Builder - all of them are ignored
val okHttpClient = OkHttpClient.Builder()
.apply {
addInterceptor { chain ->
val accessToken = "...."
val request = chain.request().newBuilder()
.header("Authorization", "$accessToken")
.build()
chain.proceed(request)
}
}
.build()
val options = IO.Options()
options.callFactory = okHttpClient
options.webSocketFactory = okHttpClient
I noticed that your client based on https://github.com/socketio/socket.io-client-java, and they described ability to add headers by using some transport event

but I didn't find any similar API in Scarlet. Do you plan to add support of headers for SocketIO client?