Skip to content

unknown protocol: ws #30

@XDao7

Description

@XDao7

我在Android Studio中使用implementation("dev.icerock.moko:socket-io:0.4.0")的方式引入了这个库,然后按照readme的示例代码,使用了ws://...类型的地址,发生了如下报错:

Caused by: java.lang.RuntimeException: java.net.MalformedURLException: unknown protocol: ws
	at io.socket.client.Url.parse(Url.java:52)
	at io.socket.client.IO.socket(IO.java:61)
	at io.socket.client.IO.socket(IO.java:42)
	at dev.icerock.moko.socket.Socket.<init>(Socket.kt:25)

在socket.io-client-java中查找到了类似的issues,看起来socket.io-client-java已经修复了这个问题。在io.socket.client.IO类中使用了URI而不是URL。

The following is the translation:
I introduced this library in Android Studio using implementation("dev.icerock.moko:socket-io:0.4.0"), and then used the ws://... type address according to the sample code in the readme. , the following error occurred:

Caused by: java.lang.RuntimeException: java.net.MalformedURLException: unknown protocol: ws
	at io.socket.client.Url.parse(Url.java:52)
	at io.socket.client.IO.socket(IO.java:61)
	at io.socket.client.IO.socket(IO.java:42)
	at dev.icerock.moko.socket.Socket.<init>(Socket.kt:25)

Similar issues were found in socket.io-client-java. It seems that socket.io-client-java has Fixed this issue.URI is used instead of URL in io.socket.client.IO class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions