import { Injectable } from '@nestjs/common' ; import io from 'socket.io-client' ; @ Injectable ( ) export class AppService { getHello ( ) { const socket = io ( 'http://localhost:9003' ) ; socket . emit ( 'message' , 'hello from a client on the backend' ) ; return 'Hello World!' ; } }