
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
grunt-connect-socket.io
Advanced tools
Start a connect web server with Socket.io support, based on grunt-contrib-connect
Start a connect web server, optionally with socket.io enabled.
This plugin is a fork of Grunt's official grunt-contrib-connect with Socket.IO support added. This README only describes the Socket.IO additions; for all other options available you should consult the grunt-contrib-connect docs.
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-contrib-connect --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-connect-socket.io');
Run this task with the grunt connect
command.
Note that this server only runs as long as grunt is running. Once grunt's tasks have completed, the web server stops. This behavior can be changed with the keepalive option, and can be enabled ad-hoc by running the task like grunt connect:keepalive
.
Type: Boolean
Default: false
Determines if Socket.IO should be loaded.
In this example, grunt connect
(or more verbosely, grunt connect:server
) will start a static web server at http://localhost:9001/
, with its base path set to the www-root
directory relative to the gruntfile, and any tasks run afterwards will be able to access it. Socket.IO is enabled.
// Project configuration.
grunt.initConfig({
connect: {
server: {
options: {
port: 9001,
base: 'www-root',
socketio: true
}
}
}
});
Once the connect and Socket.IO servers are running, a grunt event will be emitted as connect.{taskName}.socketio.listening
and the config option gets a copy of the listening Socket.IO object at {configBase}.connect.{taskName}.socketio
.
Now you can use Socket.IO elsewhere, e.g.:
var grunt = require('grunt');
var config = grunt.config.data.connect.use_socket_io;
var socketio = config.socketio;
socketio.sockets.on('connection', function(socket) {
socket.emit('test', {message: "Hello!"});
});
Task submitted by "Cowboy" Ben Alman
This file was generated on Fri Feb 28 2014 22:38:50.
FAQs
Start a connect web server with Socket.io support, based on grunt-contrib-connect
We found that grunt-connect-socket.io 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.