Feature Request
Motivation
For regular routes you can test them without listening on any tcp port using router.oneshot(Request::builder()...). For websockets however the WebSocketUpgrade extractor needs the hyper::upgrade::OnUpgrade extension which does not have a public constructor. Adding one has been rejected by hyper in hyperium/hyper#4034.
Proposal
Create an alternative to OnUpgrade that has a public constructor accepting an AsyncRead + AsyncWrite object that can be added as extension to a Request which is checked by WebSocketUpgrade if there is no hyper::upgrade::OnUpgrade extension.
Alternatives
Locally patch hyper to make the OnUpgrade constructor public. This would effectively require vendoring hyper to be able to run in CI and make it impossible to publish the project in question to crates.io.
Feature Request
Motivation
For regular routes you can test them without listening on any tcp port using
router.oneshot(Request::builder()...). For websockets however theWebSocketUpgradeextractor needs thehyper::upgrade::OnUpgradeextension which does not have a public constructor. Adding one has been rejected by hyper in hyperium/hyper#4034.Proposal
Create an alternative to
OnUpgradethat has a public constructor accepting anAsyncRead + AsyncWriteobject that can be added as extension to aRequestwhich is checked byWebSocketUpgradeif there is nohyper::upgrade::OnUpgradeextension.Alternatives
Locally patch hyper to make the
OnUpgradeconstructor public. This would effectively require vendoring hyper to be able to run in CI and make it impossible to publish the project in question to crates.io.