bugfix(microservices): let use unicode characters in TCP Microservice messages

add own json-socket implementation

https://github.com/nestjs/nest/issues/1734
This commit is contained in:
Ivan Vibe
2019-03-21 02:49:23 +05:00
parent 01b06f3848
commit 9c3e15a902
12 changed files with 928 additions and 26 deletions

View File

@@ -1,5 +1,4 @@
import { Logger } from '@nestjs/common';
import * as JsonSocket from 'json-socket';
import * as net from 'net';
import { share, tap } from 'rxjs/operators';
import {
@@ -14,6 +13,7 @@ import {
ClientOptions,
TcpClientOptions,
} from '../interfaces/client-metadata.interface';
import { JsonSocket } from '../json-socket';
import { ClientProxy } from './client-proxy';
import { ECONNREFUSED } from './constants';
@@ -42,7 +42,7 @@ export class ClientTCP extends ClientProxy {
this.socket = this.createSocket();
this.bindEvents(this.socket);
const source$ = this.connect$(this.socket._socket).pipe(
const source$ = this.connect$(this.socket.netSocket).pipe(
tap(() => {
this.isConnected = true;
this.socket.on(MESSAGE_EVENT, (buffer: WritePacket & PacketId) =>