Skip to content

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

Open
@godtaehee

Description

@godtaehee

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy