This fixes an issue where code-server and other Express applications
fail with "app.server.getConnections is not a function" when trying
to query active connection counts.
Changes:
- Added _connections counter to http.Server constructor
- Increment _connections when a new socket connection is established
- Decrement _connections when a socket closes
- Added getConnections() method to http.Server prototype that
matches Node.js behavior
The implementation follows the same pattern as net.Server's
getConnections() method, calling the callback with (null, count)
where count is 0 if the server is closed.
Fixes issue with running code-server on Bun where the application
would fail when checking active connections.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>