
Security News
Ruby's Bundler 4.0.18 Extends Cooldown to bundle lock and bundle cache
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.
@playertwo/transport-iframe-bridge
Advanced tools
Iframe-based transport for sandboxed multiplayer testing
Iframe-based transport for sandboxed multiplayer testing. Enables local two-player testing in sandboxed iframes, perfect for IDE dual-view mode.
┌─────────────────────────────────────┐
│ Parent Window (IDE Component) │
│ │
│ ┌─────────────────────────────┐ │
│ │ IframeBridgeRelay │ │
│ │ (message hub) │ │
│ └──────────┬──────────────┬───┘ │
│ │ │ │
│ postMessage postMessage │
│ │ │ │
│ ┌──────────▼──────┐ ┌─────▼──────┐│
│ │ Host Iframe │ │Client Iframe││
│ │ IframeBridge │ │IframeBridge ││
│ │ Transport │ │Transport ││
│ └─────────────────┘ └────────────┘│
└─────────────────────────────────────┘
import { IframeBridgeRelay } from '@playertwo/transport-iframe-bridge';
// Create relay (message hub)
const relay = new IframeBridgeRelay();
// Iframes will auto-register when they create transport instances
import { IframeBridgeTransport } from '@playertwo/transport-iframe-bridge';
import { GameRuntime } from '@playertwo/core';
import { myGame } from './game';
// Create transport (auto-registers with parent relay)
const transport = new IframeBridgeTransport({
roomId: 'my-room',
isHost: true
});
// Create runtime
const runtime = new GameRuntime(myGame, transport, { isHost: true });
| Feature | LocalTransport | IframeBridgeTransport |
|---|---|---|
| Use Case | Same JS context | Sandboxed iframes |
| Speed | Instant (direct calls) | Near-instant (postMessage) |
| Isolation | No sandbox | Full sandbox isolation |
| Testing | Unit tests, DualViewDemo | IDE dual-view, sandboxed tests |
TrysteroTransport for P2PLocalTransport (faster, simpler)LocalTransportclass IframeBridgeTransport implements Transport {
constructor(config: IframeBridgeConfig);
send(message: WireMessage, targetId?: string): void;
onMessage(handler: (msg: WireMessage, senderId: string) => void): () => void;
onPeerJoin(handler: (peerId: string) => void): () => void;
onPeerLeave(handler: (peerId: string) => void): () => void;
onHostDisconnect(handler: () => void): () => void;
getPlayerId(): string;
getPeerIds(): string[];
isHost(): boolean;
disconnect(): void;
}
class IframeBridgeRelay {
constructor();
// Auto-registers iframes via postMessage
// No manual registration needed in most cases
getPeers(): PeerInfo[];
getPeersInRoomById(roomId: string): PeerInfo[];
destroy(): void;
}
MIT
FAQs
Iframe-based transport for sandboxed multiplayer testing
We found that @playertwo/transport-iframe-bridge demonstrated a healthy version release cadence and project activity because the last version was released less than 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
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.

Company News
Socket is now in the AWS Security Hub Extended plan. Adopt it through AWS, apply committed spend, and block malicious open source packages.