Analyzer::Javascript::SocketIO
Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object
Surfaces Socket.IO real-time attack surface as ws:// endpoints. A
Socket.IO server handles inbound client messages via
socket.on("event", ...) handlers inside a connection callback;
io.of("/namespace") scopes handlers to a namespace. Each inbound
event becomes one endpoint ws://<namespace>/<event> (default
namespace → ws://<event>), method "SEND", protocol "ws" — so the
existing WebsocketTagger tags them. Outbound emit/send calls
(server → client) are not attack surface and are ignored.
Per-file line scan (Socket.IO server setup and its handlers are
co-located). A namespace cursor tracks which .of("/ns") connection
block the current socket.on handlers belong to.
Constants
A connection handler on a receiver variable: admin.on("connection".
Any <recv>.on("event", ...) handler.
const admin = io.of("/admin") — binds a variable to a namespace.
A connection handler on an inline namespace: io.of("/x").on("connection".
Socket.IO / EventEmitter reserved events that are lifecycle signals, not client-invocable application messages.
The socket parameter bound by a connection callback:
.on("connection", (socket) => …, … , async function (client) {, etc.
Only .on(...) calls on such a bound variable are treated as socket
event handlers, so unrelated emitters that co-locate with the server
(process.on("SIGTERM"), httpServer.on("error")) don't leak phantom
events.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.