This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I'm trying to translate the code below into Godot but im failing to understand how to achieve that.

public static class Program {
    private static WebSocket Connection = null;

    static void Main(string[] args) {
        Connection = new WebSocket("wss://" + PORT+ "/", "wamp");
        Connection.SetCredentials("riot", "PASSWORD", true);
        Connection.SslConfiguration.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12;

        Connection.OnMessage += OnWebsocketMessage;


    private static void OnWebsocketMessage(object sender, MessageEventArgs e) {
        var Messages = JArray.Parse(e.Data);

(It uses following implementation:

My current code uses the WebSocketClient and the function connect_to_url and it connects to the url wss:// It emits the signal connection_error afterwards.

How do I pass the credentials within the WebSocketClient in Godot?
What do I do with the used Tls12 protocol? Do i need a SSL-Certificate? How would the certificate look like?
Im finding no answer to my questions and the emission of that signal with no further information doesn't help me in any way sadly.

Any help is very much appreciated :)

in Engine by (66 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.