websocket-sharp | A C # implementation of the WebSocket protocol client | Websocket library
kandi X-RAY | websocket-sharp Summary
kandi X-RAY | websocket-sharp Summary
A C# implementation of the WebSocket protocol client and server
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of websocket-sharp
websocket-sharp Key Features
websocket-sharp Examples and Code Snippets
Community Discussions
Trending Discussions on websocket-sharp
QUESTION
Hey guys I'm making a unity webGL build with websocketsharp, https://github.com/sta/websocket-sharp
Weird thing is it works fine when I run it from client, I can send and receive messages with nodeJS but when I upload the build to my server I get this error when I try to connect to the server
12/5/2021 6:53:40 PM|Fatal|.|System.Net.Sockets.SocketException (0x80004005): Could not resolve host 'mydomain.io' Desktop.loader.js:1 at System.Net.Dns.Error_11001 (System.String hostName) [0x00000] in <00000000000000000000000000000000>:0
here is how I am connecting in C#
ws = new WebSocket("wss://mydomain.io:8000"); ws.SetProxy("https://mydomain.io/server", "", "");
I have no idea how to debug this. Why would it work in the unity editor but not when I upload to the server? Is websocketssharp the best way to communicate with a nodeJS server?
...ANSWER
Answered 2021-Dec-06 at 07:13As far as I understand in general WebSocket
and networking .Net / c#
classes are not supported in WebGL. You would need to either do the networking on JavaScript
side or use UnityWebRequest
.
In particular from the linked asset you are using
It works with Unity Free, but there are some limitations:
- Security Sandbox of the Webplayer (The server is not available in Web Player)
- WebGL Networking (Not available in WebGL)
Why would it work in the unity editor but not when I upload to the server?
-> Because within the Unity Editor you are still executing the pre-compiled .Net
code on your standalone PC where these classes are fully supported. It isn't compiled into WebGL
until you actually build your project.
QUESTION
I have a rather complicated real-time web application with a C# server as a back-end that also runs a Websocket
server.
I am currently in the process of upgrading it to support HTTPS, having done that already (using OWIN self host, .NET Framework 4.6.1) I also need to do so for the Websockets (used for updating the clients on changes in the server)
The Websocket server is implemented using the wonderful websocket-sharp library
Ihe problem I'm facing is this:
No matter what I do, i allways seem to get this frustrating exception in my server side, after the call to SslStream.AuthenticateAsServer
.
now, I have tried also using a different Websocket server (Fleck) and the issue remains, so I'm prety sure that it has something to do with my certificate.
I am using a self signed certificate, and I have tried to create this certificate in many ways, including the build-in windows certificate enrollment, PowerShell 'New-SelfSignedCertificate' and no matter what certificate I use, I allways get this exception:
ANSWER
Answered 2021-Jul-13 at 06:12OK, so i was able to figure it out. posting the answer here in case anyone else has had this issue.
I needed to set the Common Name in the certificate to some name, then add that name to the hosts file and use that name when addressing the server (before i was using my computer name) so lets say i create the certificate with
CN=webserver
then in hosts file added
127.0.0.1 webserver
and it worked.
i just don't understand why the certificate was rejected in the server, and not in the client.
QUESTION
Been using this client library: [Websocket Sharp][1] to implement my websocket client for WPF application. The problem is, if I used the SetProxy method of this library to connect with NGINX with no basic auth, I cannot establish a connection even if the NGINX server doesn't have a basic auth configured.
But all is working fine when I connect the client directly to backend server witout passing NGINX.
Here is my client code:
...ANSWER
Answered 2021-May-22 at 03:10Solved the issue.
Just need to make sure that the route in the NGINX and endpoint configured in stomp must be exactly the same.
For example
NGINX Route:
QUESTION
I'm using Websocket-Sharp to do this.
This code works when I use it but I can't because I need it to happen once a WebSocket message is received
...ANSWER
Answered 2021-Apr-27 at 18:40Is this socket system multithreaded? if it is you need treadsafe system.
QUESTION
I'm trying to use a C# Socket.IO implementation for IPC with my Node server.
I looked up a few examples online and the Socket.IO seems to establish, however it's not triggering events.
I was using this article for the basic example that had been confirmed working but haven't had much luck. (websocket-sharp how to work with socketio server and send "emit" request)
I've tried to debug a working Node - Node / Client - Server implementation to see where this might be going wrong but I honestly can't tell. Also the post request I found on this answer here: Communicating with a socket.io server via c# so I first thought it was required to use a post request and in a Wireshark capture I can see a get request, though I think that may just be part of the io engine..
I can see that data is being received by the server but when I do a debug on the Node server I get the following:
...ANSWER
Answered 2021-Jan-31 at 10:55For anyone having this issue... I have managed to fix this after I did some reading and found What do these numbers mean in socket.io payload?
To get this working I had to change my on open message to
QUESTION
I'm completely stuck. My game in unity works well in the editor, but crashes on launch on IOS. I'm using AWS Gamelift for multiplayer, which might be the culprit since it built fine before integrating it. For the actual networking code I'm using the new unity DOTS Netcode package.
In my plugins folder I have the following dlls for the client.
- AWSSDK.CognitoIdentity
- AWSSDK.CognitoIdentityProvider
- AWSSDK.CognitoSync
- AWSSDK.Core
- AWSSDK.Extensions.CognitoAuthentication
- AWSSDK.Gamelift
- AWSSDK.Lambda
- AWSSDK.SecurityToken
- Microsoft.Bcl.AsyncInterfaces
- System.Threading.Tasks.Extensions
- log4net
In the editor everything runs perfectly. I can connect to GameLift, create a game session etc. When I build, it completes successfully, but crashes on launch, showing a empty scene with a skybox, and the following error in Xcode console:
...ANSWER
Answered 2020-Dec-02 at 21:16I managed to solve this issue with much difficulty and a solid week of work. Here are the steps I did to fix it. in case anyone else has problems in the future.
- Make sure I had updated AWS SDK dlls. I got these with nuget in rider, then dragged the netstandard2.0 dll into the plugins folder. Note: Look very carefully at the dependencies listed in nuget. I had to use a slightly older version the AWS SDK to be compatible with the cognitoAuthentification.dll.
Here is a screenshot of the packages in rider. The package versions seemed to matter a lot. Check the dependencies carefully.
Use Amazon.Extensions.CognitoAuthentication.dll and NOT AWSSDK.Extensions.CognitoAuthentication.dll
Delete everything in link.xml file. Only include the following entry:
QUESTION
I have a problem hosting WebSocket-Sharp on a public internet IP. Locally it works fine. This problem occurs on Windows and Linux. I do no receive a timeout or an HTTP status code, the page blocks immediately. I'm 99% sure I have port forwarding set up correctly; I've tried with an Android modem, VPN and regular NAT router setup.
I've tried the following combinations:
192.168.1.2:80 8080 5000 39393
0.0.0.0: ....
public IP: ....
...ANSWER
Answered 2020-Oct-23 at 19:00Ok, assuming your server with the public Ip addres is Linux:
- Check what ports are listening and what program are listening in those
QUESTION
I find it very difficult to find a simple reliable library to use, in Unity, for a simple websocket client. WebSocketSharp (ie, https://github.com/sta/websocket-sharp ) seems fine but many items are unexplained.
When incoming messages arrive,
...ANSWER
Answered 2020-Sep-15 at 21:26I worked on some very big titles in mobile games and we used Best HTTP for them, and it works absolutely great - If this is for work, it's 100% worth it's price for the high quality features you get.
I actually even hired the guy who made the plugin to ensure we don't have any bugs in certain parts of the library, and I even went over his code personally, and it is one of the highest standards of architecture I've ever seen in the asset store. (BTW we did not find a single bug or memory leak in all parts of the code we examined)
And regarding using a queue and deqeueing it on the Unity main thread; that is 100% absolutely the correct way of going about it. I'm not sure about the specific implementation in the plugin you are referring to; but I'm very confident that they open a thread for the TCP connection.
QUESTION
I'm building a c# application that connects to a websocket using WebSocket-sharp and I keep receiving a 403 - Forbidden from the server.
I have tried using fiddler to see how the browser handle it differently and I have copied all the local cookies the website is using.
The request:
...ANSWER
Answered 2020-Feb-03 at 20:44I've looked at that particular API, and you first have to create a 'search'. That is what your lg8jphV is - the endpoint has to actually exist before you can open it. In my test, for example, my websocket URL is wss://www.pathofexile.com/api/trade/live/Metamorph/Ab3LSL
First post your search to https://www.pathofexile.com/api/trade/search/Metamorph
. Your body should look something like this (except with your specific search terms):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install websocket-sharp
You should add your websocket-sharp.dll (e.g. /path/to/websocket-sharp/bin/Debug/websocket-sharp.dll) to the library references of your project. If you would like to use that dll in your Unity project, you should add it to any folder of your project (e.g. Assets/Plugins) in the Unity Editor.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page