Skip to content

NetHook: per-session network hook (groundwork for one LAN IP per session) - #68

Merged
mlopezsegura merged 2 commits into
masterfrom
feature/per-session-network
Nov 16, 2026
Merged

mlopezsegura merged 2 commits into
masterfrom
feature/per-session-network

Conversation

@mlopezsegura

Copy link
Copy Markdown
Collaborator

Groundwork for giving each session its own LAN IP through a Hyper-V virtual adapter (bridge or NAT), described in ROADMAP section 5.

Native/NetHook: user-mode DLL (x64 and x86) loaded into a session's processes and passed on to every child, including children of the other architecture through osms-netinject.exe:

  • IPv4 sockets without an address are bound to the session adapter's IP; multicast joins use it too; loopback connects to a server of the session are redirected to the session IP
  • With HideOthers, adapter enumeration and the computer name lookup only show the session adapter, loopback and allowed adapters
  • Config per Windows session in HKLM\SOFTWARE\OpenStreamMS\NetSessions\<id>, or OSMS_NETHOOK_* environment variables for tests

Not wired into the service or the installer yet, so this changes nothing at runtime.

Tested: service build, unit and i18n tests (the native DLL is built separately with Native/NetHook/build.cmd).

🤖 Generated with Claude Code

mlopezsegura and others added 2 commits November 16, 2026 20:33
…ession (bridge or NAT)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r, hide the other adapters)

User-mode DLL (x64 and x86) loaded into a session's processes and passed on to every child,
including children of the other architecture through osms-netinject.exe:
- IPv4 sockets without an address (bind to 0.0.0.0, connect/sendto without bind) are bound to the
  session adapter's IP; multicast joins use it too; loopback connects to a server of the session
  are redirected to the session IP.
- With HideOthers, adapter enumeration (GetAdaptersAddresses/Info, MIB tables) and the computer
  name lookup only show the session adapter, loopback and AlsoShow adapters (e.g. a ZeroTier of
  the session, which is not forced).
- Config per Windows session in HKLM\SOFTWARE\OpenStreamMS\NetSessions\<id>, or OSMS_NETHOOK_*
  environment variables for tests. Not wired into the service or the installer yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mlopezsegura
mlopezsegura merged commit 0fd1092 into master Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant