Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ngx-socksjs
Advanced tools
Easy to use, plug and play type of Stomp Websocket for Angular based on (ng2-stompjs).
SocksJS module for Angular
Socket.IO inspired wrapper over Stomp Websocket for Angular.
Since this is a wrapper of already existing Angular Stomp library, first install the core one:
npm i @stomp/ng2-stompjs
and then the wrapper.
npm install ngx-socksjs
import { SocksJSModule } from 'ngx-socksjs';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SocksJSModule.forRoot({ url: 'ws://<domain>:<port>/<server_endpoint>', options: {} })
],
providers: [],
bootstrap: [ AppComponent ]
})
export class AppModule { }
We need to configure SocksJSModule
module using the object config
of type SocksConfig
.
Now we pass the configuration to the static method forRoot
of SocksJSModule
The SocksJSModule
provides now a configured Socket
service that can be injected anywhere inside the AppModule
.
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { SocksJS } from 'ngx-socksjs';
@Injectable({ providedIn: 'root' })
export class SocketService {
constructor(
private socksJS: SocksJS
) { }
onEvent(): Observable<any> {
return this.socksJS.fromEvent<any>('/receive');
}
send(payload: any): void {
this.socksJS.emit('/send', payload);
}
}
Most of the functionalities here you are already familiar with.
The only addition is the fromEvent
method, which returns an Observable
that you can subscribe to.
socksJS.emit(eventName: string, payload: any): void
Sends a message to the server. Works the same as in Socket.IO.
socksJS.fromEvent<T>(eventName: string): Observable<T>
Takes an event name and returns an Observable that you can subscribe to.
MIT
FAQs
Easy to use, plug and play type of Stomp Websocket for Angular based on (ng2-stompjs).
The npm package ngx-socksjs receives a total of 10 weekly downloads. As such, ngx-socksjs popularity was classified as not popular.
We found that ngx-socksjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.