Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@php-wasm/xdebug-bridge

Package Overview
Dependencies
Maintainers
8
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@php-wasm/xdebug-bridge

XDebug bridge server for PHP.wasm

Source
npmnpm
Version
3.1.30
Version published
Weekly downloads
44K
-2.89%
Maintainers
8
Weekly downloads
 
Created
Source

@php-wasm/xdebug-bridge

A bridge server for XDebug and PHP.wasm that facilitates debugging connections between XDebug and Browser devtools.

Installation

npm install @php-wasm/xdebug-bridge

Usage

Programmatic API

import { startBridge } from './xdebug-bridge/src/start-bridge';

// Start with default settings
const server = startBridge();
await server.start();
import { startBridge } from './xdebug-bridge/src/start-bridge';

// Start with custom configuration
const server = startBridge({
	cdpHost: '127.0.0.1', // CDP connection host
	cdpPort: 9229, // CDP connection port
	dbgpPort: 9003, // XDebug connection port
	phpRoot: './', // Root to directory
});

await server.start();

CLI Usage

# Start with default settings
npx xdebug-bridge

# Custom port and verbose logging
npx xdebug-bridge --port 9000 --verbosity debug

# Show help
npx xdebug-bridge --help

Configuration Options (CLI)

  • port: Xdebug port to listen on (default: 9003)
  • host: Xdebug host to bind to (default: 'localhost')
  • php-root: Path to PHP root directory (default: './')
  • verbosity: Output logs and progress messages (choices: "quiet", "normal", "debug") (default: "normal")
  • help: Display help

Configuration Options (API)

  • cdpPort: Port to listen for CDP connections (default: 9229)
  • cdpHost: Host to bind to (default: '127.0.0.1')
  • dbgpPort: Port to listen for XDebug connections (default: 9003)
  • phpRoot: Root path for php files
  • verbosity: Output logs and progress messages (choices: "quiet", "normal", "debug") (default: "normal")
  • phpInstance: PHP instance
  • getPHPFile: Custom file listing function
  • breakOnFirstLine: Breaks on the first breakable line

Events

The bridge listens to events for monitoring connection activity:

From Xdebug

  • connected: Xdebug Server has started
  • disconnected: Xdebug Server has stopped
  • message: Raw XDebug data received
  • error: Xdebug Server error occurred

To Devtools

  • clientConnected: Devtools client connected
  • clientDisconnected: Devtools client disconnected
  • message: Raw Devtools data received
  • error: Devtools client error occurred

FAQs

Package last updated on 11 May 2026

Did you know?

Socket

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.

Install

Related posts