Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
dgram-server
Advanced tools
Readme
Stream-based UDP server.
Doesn't properly work with cluster.
const dgramsrv = require('dgram-server')
const server = dgramsrv.createServer()
server.on('socket', (socket) => {
socket.on('data', (data) => {
console.log('got %s bytes from %s:%s', data.length, socket.remoteAddress, socket.remotePort)
socket.write('hello, world!', () => {
socket.close()
})
})
})
server.listen(() => {
console.log('udp server started on 0.0.0.0:%s', server.address().port)
})
createServer([options: Object]): Server
Creates a new UDP server. Also accept all options for dgram.createSocket()
. If options.socket
is provided, these options will be ignored.
option.socket: dgram.Socket
An optional internal dgram
socket used as transport layer.
class Server
This class is used to create a UDP server. Server
is an EventEmitter with the following events:
Event: 'socket'
socket: unicast.Socket
Emitted when a new association is made. socket
is an instance of unicast.Socket
.
Event: 'listening'
Emitted when the server has been bound after calling server.listen()
server.listen([port: number[, host: string]][, callback: function])
server.listen()
Start a server listening for associations. When the server starts listening, the 'listening'
event will be emitted. The last parameter callback
will be added as a listener for the 'listening'
event.
server.close()
Close the underlying socket and stop listening for data on it.
server.address(): Object
Returns the bound address, the address family name, and port of the server as reported by the operating system. Useful to find which port was assigned when getting an OS-assigned address. Returns an object with port
, family
, and address
properties: { port: 12346, family: 'IPv4', address: '127.0.0.1' }
.
Don't call server.address()
until the 'listening' event has been emitted.
server.connections: number
The number of concurrent associations on the server.
unicast
- Unicast implementation of UDP Datagram sockets.MIT, 20!8 (c) Dmitriy Tsvettsikh
FAQs
Stream-based UDP server.
The npm package dgram-server receives a total of 0 weekly downloads. As such, dgram-server popularity was classified as not popular.
We found that dgram-server 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.