Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@foxglove/electron-socket
Advanced tools
Networking sockets for Electron apps
Raw sockets are not supported in browser contexts, even in Electron apps. To overcome this limitation, this package uses RPC between the Electron renderer context (referred to in this package as the "renderer" and in Electron documentation as "main world") and the preloader (referred to in Electron documentation as "isolated world" when running with contextIsolation: true
) to expose TCP/UDP sockets and server classes in the renderer context. The API somewhat resembles net.Socket
/dgram.Socket
and net.Server
from node.js, with Promise-based methods since these classes are built on asynchronous RPC.
// preload.ts ////////////////////////////////////////////////////////////////
import { PreloaderSockets } from "@foxglove/electron-socket/preloader";
PreloaderSockets.Create();
// renderer.ts ///////////////////////////////////////////////////////////////
import { Sockets } from "@foxglove/electron-socket/renderer";
async function main() {
const net = await Sockets.Create();
const server = await net.createServer();
server.on("connection", (client) => {
client.write(new Uint8Array([42]));
});
server.listen(9000);
const socket = await net.createSocket();
socket.on("data", (data: Uint8Array) => console.log(`Server sent ${data}`));
socket.connect({ port: 9000, host: "localhost" });
}
main();
@foxglove/electron-socket is licensed under the MIT License.
A small example Electron app is provided in the example directory, which can be used for manual testing. Run it using yarn example
.
yarn version --[major|minor|patch]
to bump versiongit push && git push --tags
to push new tagJoin our Slack channel to ask questions, share feedback, and stay up to date on what our team is working on.
FAQs
Networking sockets for Electron apps
The npm package @foxglove/electron-socket receives a total of 323 weekly downloads. As such, @foxglove/electron-socket popularity was classified as not popular.
We found that @foxglove/electron-socket demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.