Questions tagged [clientwebsocket]

WebSocket clients are the applications that use the WebSocket API to communicate with WebSocket servers using the WebSocket protocol.

WebSocket clients are the applications that use the WebSocket API to communicate with WebSocket servers using the WebSocket protocol.

41 questions
1
vote
0 answers

ClientWebSocket Alternative That Can Access HTTP Response Headers in Server Handshake Response?

I am developing a WebSocket client application using C#/.NET. Up until this point, I have been using the class System.Net.WebSockets.ClientWebSocket to implement the client. Unfortunately, I recently discovered that…
Felix
  • 25
  • 3
1
vote
0 answers

How do I change the "Source IP" of ClientWebSocket and HttpClient (GET, POST) in C #?

I am using a VPS server with several white IP addresses. I need to make connections to the server using HttpClient and ClientWebSocket that has a command processing limit set. How do I change the source IP in the HttpClient and ClientWebSocket…
1
vote
0 answers

Problem with connecting to WebSocket from ClientWebSocket in Android

I have written an app to connect to WebSocket via ClientWebSocket. This is the setting of middle ware part in Asp.Net core: app.Use(async(context,next) => { if(context.WebSockets.IsWebSocketRequest) { …
1
vote
1 answer

Get Data from WebSocket using .Net ClientWebSocket

I need to collect data from a WebSocket. If I try to test the websocket with this site: http://www.websocket.org/echo.html I can connect and send message without problem but when I try to connect to the websocket using .Net Framework libraries I…
DarioN1
  • 2,460
  • 7
  • 32
  • 67
0
votes
1 answer

Azure Web PubSub ClientWebSocket "The server returned status code '401' when status code '101' was expected."

I am trying to use the Web PubSub Service resource in Azure, and have created a basic client using ClientWebSocket. Everything is fine, it sits there waiting for something to come through, however, after 36 hours or so (take that time with a pinch…
percentum
  • 113
  • 3
  • 13
0
votes
0 answers

c#, .net.websockets - ClientCertificate

i have a websocket client and server and i'm trying to add a certificate to my client, but i don't think i have the hang of it yet.. i have an asp.net core 7 web api and wonder what i do wrong Client: public async Task GetEcho(string…
0
votes
0 answers

How to send WebSocket request through proxy in C#?

I am trying to send request over websocket through proxy in C# but I am getting server unavailable error. However it works without proxy. I have the following code:- strCompleteURL = "ws://xxxxxxxxxxxxxxxx"; …
Puneet Pant
  • 918
  • 12
  • 37
0
votes
1 answer

.Net ClientWebSocket ReceiveAsync throwing The remote party closed the WebSocket

I have a Console App that needs to send a message to a web socket and after receive messages from it. The problem I am having is, when ClientWebSocket "ReceiveAsync" method is called, I am getting the following error message: The remote party…
MarchalPT
  • 1,268
  • 9
  • 28
0
votes
0 answers

Setting up clientwebsocket with TLS v 1.3

I have a service which supports tls 1.3. Upon research I found that clientwebsocket only supports tls 1.2 I tried to use Clientwebsocket with http2: using SocketsHttpHandler handler = new(); Socket.ConnectAsync(Host, new HttpMessageInvoker(handler),…
julian bechtold
  • 1,875
  • 2
  • 19
  • 49
0
votes
0 answers

How to integration unit test for ClientWebSocket?

I want to create an integration test that sends data to server and gets the response from ClientWebSocket. [Fact] public async Task WebSocket_Sending() { var client = new ClientWebSocket(); await client.ConnectAsync(Uri,…
barteloma
  • 6,403
  • 14
  • 79
  • 173
0
votes
0 answers

How to debug a hung call to ClientWebSocket.ReceiveAsync

I have a C# Windows Forms Application that sends and receives data using ClientWebSocket. At some point, the call to ClientWebSocket.ReceiveAsync hangs and doesn't return. WebSocketReceiveResult webSocketReceiveResult = await…
ddrjca
  • 472
  • 2
  • 15
0
votes
1 answer

ReceiveAsync's CancellationToken paramtere is doing timeout even if the web socket client is still connected

How do I make ClientWebSocket.ReceiveAsync timeout in 5 seconds only if the web socket client is not connected? The current behavior is that it timeouts no matter what conditions are met, i.e. whether the web socket client is connected or not, which…
nop
  • 4,711
  • 6
  • 32
  • 93
0
votes
1 answer

Receiving messages using ClientWebSocket Class throws exception: The WebSocket received a frame with one or more reserved bits set

I 'd like to make a websocket client to connect to a third-party web socket server. I am using ClientWebSocket Class: public WSClientService(ClientWebSocket client, ILogger logger) { _client = client; _logger =…
ggeorge
  • 1,496
  • 2
  • 13
  • 19
0
votes
1 answer

How can I set listener for clientwebsocket in c#?

ClientWebSocket socket = new ClientWebSocket(); socket.ConnectAsync(new Uri(socketURL), CancellationToken.None); I have created ClientWebSocket using given code above in c#. Now I want to listen to the data received through this socket. How can I…
Nidhi
  • 754
  • 5
  • 9
0
votes
0 answers

Dotnet ClientWebSocket buffer size

The ClientWebSocketOptions class in dotnet provides options to the ClientWebSocket, and has a method SetBuffer to set the internal send/receive buffer size. What is an appropriate value for this? Apparently the max value in .net framework for this…
Jan Korf
  • 58
  • 10