pub fn request( host: impl AsRef<str>, path: impl AsRef<str>, headers: impl IntoIterator<Item = impl Header> ) -> (String, String)
use web_socket::handshake::request; let _ = request("example.com", "/path", [("key", "value")]);
GET /path HTTP/1.1 Host: example.com Upgrade: websocket Connection: Upgrade Sec-WebSocket-Version: 13 Sec-WebSocket-Key: D3E1sFZlZfeZgNXtVHfhKg== # randomly generated key: value ...