NativeWebSocket | πŸ”Œ WebSocket client for Unity - with no external dependencies | Websocket library

Β by Β  endel C# Version: 1.1.4 License: Non-SPDX

kandi X-RAY | NativeWebSocket Summary

kandi X-RAY | NativeWebSocket Summary

NativeWebSocket is a C# library typically used in Networking, Websocket, Unity applications. NativeWebSocket has no bugs, it has no vulnerabilities and it has medium support. However NativeWebSocket has a Non-SPDX License. You can download it from GitHub.

This is the simplest and easiest WebSocket library for Unity you can find!. This WebSocket client is used on colyseus-unity3d. Consider supporting my work on Patreon.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              NativeWebSocket has a medium active ecosystem.
              It has 855 star(s) with 120 fork(s). There are 29 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 43 open issues and 27 have been closed. On average issues are closed in 20 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of NativeWebSocket is 1.1.4

            kandi-Quality Quality

              NativeWebSocket has 0 bugs and 0 code smells.

            kandi-Security Security

              NativeWebSocket has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              NativeWebSocket code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              NativeWebSocket has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              NativeWebSocket releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of NativeWebSocket
            Get all kandi verified functions for this library.

            NativeWebSocket Key Features

            No Key Features are available at this moment for NativeWebSocket.

            NativeWebSocket Examples and Code Snippets

            No Code Snippets are available at this moment for NativeWebSocket.

            Community Discussions

            QUESTION

            Unity WebGL throws Error: "ReferenceError: Runtime is not defined"
            Asked 2021-Dec-29 at 16:12

            I wanted to export my Unity project (Unity Version 2021.2) for WebGL, but I get this Error:

            An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: ReferenceError: Runtime is not defined unityFramework/_WebSocketConnect/instance.ws.onopen@http://localhost:55444/Build/WEbGL.framework.js:3:67866

            I am using this Websocket package (https://github.com/endel/NativeWebSocket) an everything is working fine in Unity or in a Windows Build. When i run the WebGL build it does connect with the websocket but then i get the Error. The Error message says more info is in my console but the console on F12 only repeats the error:

            Uncaught ReferenceError: Runtime is not defined at WebSocket.instance.ws.onmessage (WEbGL.framework.js:3) instance.ws.onmessage @ WEbGL.framework.js:3

            To give a minimal reproducable example i just created a empty 3D Core project with Unity 2021.2 and imported the package NativeWebSocket (I downloaded the File from GitHub and installed it manally:

            Copy the sources from NativeWebSocket/Assets/WebSocket into your Assets directory

            Then you have to make the fixes postet by kentakang on https://github.com/endel/NativeWebSocket/pull/54 otherwise the build will fail.

            Then i made a new C# script with the code below (also from the Github page) and put it on the Camera in the Scene. I exported it for WebGL and got the mentioned Error.

            This happens when one of the Methods websocket.OnOpen/OnError/OnClose/OnMessage is called, so you donΒ΄t even need a running websocket because then websocket.OnError is called and the WebGL Build throws the "Runtime is not defined" Error. Or if you have also the running Websocket server which is also included in the package you get the Error when websocket.OnOpen is called.

            ...

            ANSWER

            Answered 2021-Dec-28 at 09:08

            It seams that in unity 2021.2 variable Runtime doesn't exist and can be replaced with Module['dynCall_*'].

            In webSocket.jslib change all Runtime.dynCall('*1', *2, [*3, *4]) for Module['dynCall_*1'](*2, *3, *4)

            Example instance.ws.onopen function in WebSocket.jslib:

            Source https://stackoverflow.com/questions/70411564

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install NativeWebSocket

            Open Unity
            Open Package Manager Window
            Click Add Package From Git URL
            Enter URL: https://github.com/endel/NativeWebSocket.git#upm
            Download this project
            Copy the sources from NativeWebSocket/Assets/WebSocket into your Assets directory.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/endel/NativeWebSocket.git

          • CLI

            gh repo clone endel/NativeWebSocket

          • sshUrl

            git@github.com:endel/NativeWebSocket.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Websocket Libraries

            netty

            by netty

            ws

            by websockets

            websocket

            by gorilla

            websocketd

            by joewalnes

            koel

            by koel

            Try Top Libraries by endel

            js2php

            by endelJavaScript

            increase-memory-limit

            by endelJavaScript

            joy.js

            by endelJavaScript

            generator-modern-frontend

            by endelJavaScript

            FossilDelta

            by endelC#