Socket Emit Cheat Sheet



Resource

Socket.broadcast.to(socketid).emit('message', 'for your eyes only'); // join to subscribe the socket to a given channel (server‐side): socket.join('some room'); // then simply use to or in (they are the same) when broadcasting or emitting (server‐side) io.to('some room').emit('some event'). Socket.AFINET and socket.AFINET6 represent the address and protocol families used for the first argument to socket.socket. APIs that use an address expect it to be in a certain format, depending on whether the socket was created with socket.AFINET or socket.AFINET6.

Code Cheatsheets. Code Cheatsheets. Synopsis The kubelet is the primary 'node agent' that runs on each node. It can register the node with the apiserver using one of: the hostname; a flag to override the hostname; or specific logic for a cloud provider. The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms.

Related

Basic

Global Objects

console

Timers

Util

Module

Modules

Addons

Buffer/Stream

Buffer

Stream

Socket Emit Cheat Sheet Printable

TTY

Process/Events

Process

Events

Domain

Domain

Crypto

TSL(SSL)

StringDecoder

File

File System

Net

net

UDP / Datagram Sockets

DNS

Text

Path

Query String

punnycode

Readline

HTTP

http

Class: http.Server

Class: http.ServerRequest

Class: http.ServerResponse

Class: http.Agent

Class: http.ClientRequest

http.ClientResponse

HTTPS

URL

Code

Executing JS

Child Process

Assert

System

Zlib

os

Debugger

Cluster

Sheet

3rd Party

Third Party Modules

Socket Emit Cheat Sheet Pdf

  • Module Installer: npm
  • HTTP Middleware: Connect
  • Web Framework: Express
  • Web Sockets: Socket.IO
  • HTML Parsing: HTML5
  • mDNS/Zeroconf/Bonjour/li>
  • Serialization: msgpack
  • Scraping: Apricot
  • Debugger: ndb is a CLI debuggerinspector is a web based tool.
  • Testing/TDD/BDD: vows,mocha,mjsunit.runner

Socket Emit Cheat Sheet Download

socket.js

Socket Emit Cheat Sheet

io.on('connection',function(socket){
/* 'connection' is a special event fired on the server when any new connection is made */
})
socket.on('disconnect',function(){
/* When this individual socket has disconnected, this special event fires */
})
/* This will send the event 'foobar' with the data to
every connected to socket */
io.emit('foobar',data)
/* This will send the event 'foobar' with the data object to
every connected socket EXCEPT for the socket this is called on */
socket.broadcast.emit('foobar',data)
socket.on('foobar',function(data){
/* Fires whenever this socket receives an event 'foobar'.
You can access the data received inside this callback*/
})
/* This will send the event 'foobar' with the data to the server */
socket.emit('foobar',data)
socket.id// A unique string identifying this socket connection
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment