-
Notifications
You must be signed in to change notification settings - Fork 110
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
Allow to specify the protocol (SSL) #68
Comments
Hi @greaterweb, thanks for the kind words. If you use I agree that the |
Thank you, @endel! That solution worked :) |
nice solution by the way. I am closing #77 Thank you 👍 |
Related: colyseus/colyseus-unity-sdk#120 |
@endel Currently, I use colyseus.js on cocos creator. My sever use https and wss. I saw Connection.ts of Client.ts extend from WebSocket. Everything is right on web but as I built my project to android, I encountered an error . it says websocket on native android of cocos doesn't support ssl. You can see the problem here('cocos/engine-native#1722') let ws = new WebSocket( url, [], cc.url.raw("resources/cacert.pem") ); I saw WebSocketClient in package @gamestdio extend WebSocket. But I dont know how to insert cacert.pem to Connection of Client? |
@luckybk93 Không biết bạn dùng client là gì bạn. Client mình là cocos creator. Trong example của nó có file cacert.pem luôn bạn ah. |
For Cocos Creator |
Oke bác. M cũng cocos creator. Mới đầu cứ tưởng lấy file pem cấu hình ở
trên server. Mãi đếch chạy.
Thanks bác nha
Vào 23:00 Th 5, 31 thg 12 2020 Tran Cong <notifications@github.com> đã viết:
… @luckybk93 <https://github.com/luckybk93> Không biết bạn dùng client là
gì bạn. Client mình là cocos creator. Trong example của nó có file
cacert.pem luôn bạn ah.
https://github.com/cocos-creator/example-cases/blob/v2.4.3/assets/cases/05_scripting/10_network/cacert.pem
<http://url>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#68 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEA4T4ZFXPQ3K5Y3FXROX5DSXSNYVANCNFSM4MXN4AGQ>
.
|
On version 0.15, this can be achieved like this: import { Client } from "colyseus.js";
const client = new Client({
hostname: "us1.game.io",
secure: true,
port: 1234, // optional
}); |
The
createMatchMakeRequest
method currently only supports requests with thehttp
protocol, it would be nice to have support forhttps
.I think the constructor could be modified to accept an optional second parameter to either explicitly set the protocol for http requests or it could be a flag to indicate that
https
is available.As the parameter could be optional/have defaults this could viewed as a backward compatible enhancement.
I don't do have much game development experience but have been enjoying using this library, thanks for sharing it! I'd be happy to provide a PR for this feature if you have a preference to how you'd like to see this implemented.
Keep up the great work!
The text was updated successfully, but these errors were encountered: