websocket

Use websockets in NestJs and ReactJS

若如初见. 提交于 2021-01-28 05:07:44
问题 I want to use websockets using NestJs. According to the documentation i created: // events.gateway.ts import { MessageBody, OnGatewayInit, SubscribeMessage, WebSocketGateway } from "@nestjs/websockets"; @WebSocketGateway(81, { transports: ['websocket'] }) export class EventsGateway implements OnGatewayInit { @SubscribeMessage('events') handleEvent(@MessageBody() data: string): string { console.log(data, 'socket') return data; } afterInit(server: any): any { console.log('init') } } After that

Websockets ESP8266

对着背影说爱祢 提交于 2021-01-28 04:52:42
问题 I'm trying to send data to a server with websocket in ESP8266, but the handshake don't work. I'm sending the following sequence of AT commands: AT+RST AT+CWMODE=1 AT+CIPMODE=0 AT+CIPMUX=1 AT+CWJAP="ssid_my_network","password" AT+CIPSTART=4,"TCP","ip_server",port AT+CIPSEND=4,data_lenght In this moment, i send the header: GET ws:ip_server HTTP/1.1\r\n Host: ip_server\r\n Upgrade: websocket\r\n Connection: Upgrade\r\n Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n Sec-WebSocket-Version: 13\r\n

Web socket client connection issue in Windows 8.1+ IE 11 + loopback not allowed

泪湿孤枕 提交于 2021-01-28 04:48:37
问题 I am have created a C++ web socket server. I am trying to access it from IE 11 using web socket Javascript API. I am trying to connect to localhost. function JSInit() { try { var host = "ws://127.0.0.1:25000/test"; remoteEngine = new WebSocket(host); remoteEngine.onopen = onWebSocketOpen; remoteEngine.onmessage = onRecvMessage; remoteEngine.onclose = onWebSocketClose; remoteEngine.onclose = onWebSocketError; } catch (err) { alert(err.message); } } Is there in any restriction on accessing

Socket is not connected in iOS Swift?

Deadly 提交于 2021-01-28 02:20:47
问题 I tried to connect the server using a socket but it refuses to connect. Here I am trying to send the query parameter(token) with the base URL to connect the server. But still, it's not connecting. Here is console output error: manager <SocketIO.SocketManager: 0x283542f00> 2020-01-23 17:59:12.872248+0530 A8FlowSampleApp[34442:7736351] LOG SocketIOClient{/}: Handling event: statusChange with data: [connecting, 2] 2020-01-23 17:59:12.872415+0530 A8FlowSampleApp[34442:7736351] LOG SocketIOClient{

JHipster support websockets in microservice architecture

落花浮王杯 提交于 2021-01-27 20:20:39
问题 I tried to implement websockets in one of the microservices in my project. However, I found out the Zuul proxy doesn't support websockets by default and jhipster developers is recommending adding websockets to gateway project as in https://github.com/jhipster/generator-jhipster/issues/7335 . Are there any better solution for this problem using a different proxy that will allow adding websockets to microservice? 来源: https://stackoverflow.com/questions/50679665/jhipster-support-websockets-in

GAE App Engine Websocket clients are disconnected after 1 hour

时光怂恿深爱的人放手 提交于 2021-01-27 19:45:30
问题 I have a simple Websocket server deployed to AppEngine, after exactly 1 hour clients are disconnected with error code 1006, I believe this is happening because of the nginx load balancer, I have tried changing nginx-app.conf, but it didn't help proxy_send_timeout 7d; proxy_read_timeout 7d; My server is sending ping / pong frames every 10 seconds, so inactivity is out of the question. The official GAE documentation states this: "WebSockets are always available to your application without any

AWS Appsync implementation using GraphQL-client library in .Net

一个人想着一个人 提交于 2021-01-27 19:43:33
问题 I am trying to implement an app sync subscription similar to this python example but in .net https://aws.amazon.com/blogs/mobile/appsync-websockets-python/ I started this using the nuget package GraphQL.Client https://www.nuget.org/packages/GraphQL.Client The execution of Query/Mutation is working fine like given in the readme of https://github.com/graphql-dotnet/graphql-client But subscription is not working. My code using the GraphQL.Client: using var graphQLClient = new GraphQLHttpClient(

AWS Appsync implementation using GraphQL-client library in .Net

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-27 19:20:29
问题 I am trying to implement an app sync subscription similar to this python example but in .net https://aws.amazon.com/blogs/mobile/appsync-websockets-python/ I started this using the nuget package GraphQL.Client https://www.nuget.org/packages/GraphQL.Client The execution of Query/Mutation is working fine like given in the readme of https://github.com/graphql-dotnet/graphql-client But subscription is not working. My code using the GraphQL.Client: using var graphQLClient = new GraphQLHttpClient(

How synchronise socketIO connection ID's on client and server?

断了今生、忘了曾经 提交于 2021-01-27 19:12:58
问题 I have a javascript GameClient that uses SocketIO to send messages to a nodeJs server. Multiple users can open the GameClient separately and send messages to the server. GameClient GameClient ---> NodeJS Server GameClient The server can send messages to specific clients using io.to(socketid).emit() . The code looks something like this: CLIENT this.socket = io({ timeout: 60000 }) this.socket.on('connect', () => Settings.getInstance().socketid = this.socket.id) this.socket.on('reconnect',

Receiving events in Pusher client

依然范特西╮ 提交于 2021-01-27 15:51:43
问题 I'm trying to connect to the BitStamp Websocket API with Python. However, I cannot find a decent tutorial or explanation of the process anywhere. What I need is to receive the live price ticker. I tried using this library but I'm not receiving any live price. I think I'm probably missing something because I'm new with WebSockets. Here is my code: import pusherclient import sys # Add a logging handler so we can see the raw communication data import logging root = logging.getLogger() root