Giter Site home page Giter Site logo

blockcoders / nestjs-websocket Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 11.0 334 KB

Websocket Client for NestJS based on ws

License: Apache License 2.0

JavaScript 1.84% TypeScript 98.16%
nest nestjs websocket websocket-client websocket-library websocket-protocol websockets ws ws-client

nestjs-websocket's People

Contributors

0xslipk avatar annriera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nestjs-websocket's Issues

Reconnect when connect closed

i used your module. However, I have a problem as follows, when the connection to the server side is closed, now I don't know how to reopen that connection. I'd love you feedback guys :D

How can I use Multiple Websocket Client with your great package?

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

I import two WebSocketModule in each different module like below code.

// upbit.module.ts
import { Module } from '@nestjs/common';
import { UpbitService } from './upbit.service';
import { WebSocketModule } from 'nestjs-websocket';
import { UpbitWebsocketClient } from './upbitWebsocketClient';

@Module({
  imports: [
    WebSocketModule.forRoot({
      url: 'wss://api.upbit.com/websocket/v1',
    }),
  ],
  providers: [UpbitService, UpbitWebsocketClient],
  exports: [UpbitWebsocketClient],
})
export class UpbitModule {}
// binance.module.ts
import { Module } from '@nestjs/common';
import { WebSocketModule } from 'nestjs-websocket';
import { BinanceService } from './binance.service';
import { BinanceWebsocketClient } from './binanceWebsocketClient';

@Module({
  imports: [
    WebSocketModule.forRoot({
      url: 'wss://stream.binance.com:9443/ws/btcusdt@trade',
    }),
  ],
  providers: [BinanceService, BinanceWebsocketClient],
  exports: [BinanceWebsocketClient],
})
export class BinanceModule {}

Expected behavior

I expected that I can use both websocket clients because I imported two websocket clients which have different url in each module(upbit.module, binance.module).

But I can only use binance websocket client.

Minimal reproduction of the problem with instructions

I don't have it.

What is the motivation / use case for changing the behavior?

We can get the information from many different WebSocket Clients.

Environment


Nest version: X.Y.Z
Nest WebSocket: X.Y.Z

 
For Tooling issues:
- Node version: v16.16.0
- Platform: Mac
- Server: Express

Others:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.