
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
github.com/anismiles/websocket-android-phonegap
Note: this plugin will be added to Phonegap-android core very soon. :) Here is the forked project: https://github.com/anismiles/phonegap-android
This is a Java library that implements Websockt API (Draft-75/76) for Android platform. Library uses java.nio.* packages for efficient non-blocking evented behavior. It easily gets integrated with Phonegap framework too.
Copy Java source into your source folder.
Copy websocket.js in your assets/www/js folder
Attach com.strumsoft.websocket.phonegap.WebSocketFactory to WebView, like this:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.loadUrl(" file:///android_asset/www/index.html ");
// attach websocket factory
appView.addJavascriptInterface(new WebSocketFactory(appView), "WebSocketFactory");
}
In your page, create a new WebSocket, and overload its method 'onmessage', 'onopen', 'onclose', like this:
// new socket var socket = new WebSocket('ws://192.168.1.153:8081');
// push a message after the connection is established. socket.onopen = function() { socket.send('{ "type": "join", "game_id": "game/6"}') };
// alerts message pushed from server socket.onmessage = function(msg) { alert(JSON.stringify(msg.data)); };
// alert close event socket.onclose = function() { alert('closed'); };
ps: It doesn't support 'onerror' event, and various states as defined by WebSocket APIs yet. I am working on it. By the way, if you like the project, join the force.
FAQs
Unknown package
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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.