In angular, SocketIoModule.forRoot(config)
in app.module.ts
keeps on trying to connect with localhost 8080 which is not running currently
const config: SocketIoConfig = {
url:"http://localhost:8080/",
options: {},
};
@NgModule({
..
imports: [
....
SocketIoModule.forRoot(config),
...
]
}
It should be try to connect to the socket server once and stop if there is some kind of error( in my case ERR_CONNECTION_REFUSED).
how to handle this exception in ngx-socket-io? little help will be appreciated
solved it by adding additional option in SocketIoConfig.