PshouldUpgradeCallback
Bun

property

https.ServerOptions.shouldUpgradeCallback

shouldUpgradeCallback?: (request: InstanceType<Request>) => boolean

A callback which receives an incoming request and returns a boolean, to control which upgrade attempts should be accepted. Accepted upgrades will fire an 'upgrade' event (or their sockets will be destroyed, if no listener is registered) while rejected upgrades will fire a 'request' event like any non-upgrade request.