From 7c7743c145264a0c2c2ccfdf79139a7aed29b178 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 27 Jan 2018 22:52:17 -0800 Subject: [PATCH] use right path --- src/ws/connect.rs | 2 -- src/ws/writer.rs | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ws/connect.rs b/src/ws/connect.rs index ed664f2e8..4cb7d0339 100644 --- a/src/ws/connect.rs +++ b/src/ws/connect.rs @@ -43,8 +43,6 @@ pub struct TcpConnector { impl TcpConnector { pub fn new>(addr: S, port: u16, timeout: Duration) -> TcpConnector { - println!("TES: {:?} {:?}", addr.as_ref(), port); - // try to parse as a regular SocketAddr first if let Ok(addr) = addr.as_ref().parse() { let mut ips = VecDeque::new(); diff --git a/src/ws/writer.rs b/src/ws/writer.rs index d31f82c50..57802b341 100644 --- a/src/ws/writer.rs +++ b/src/ws/writer.rs @@ -87,8 +87,9 @@ impl Writer { // status line // helpers::write_status_line(version, msg.status().as_u16(), &mut buffer); // buffer.extend_from_slice(msg.reason().as_bytes()); - buffer.extend_from_slice(b"GET /ws/ HTTP/1.1"); - buffer.extend_from_slice(b"\r\n"); + buffer.extend_from_slice(b"GET "); + buffer.extend_from_slice(msg.url.path().as_ref()); + buffer.extend_from_slice(b" HTTP/1.1\r\n"); // write headers for (key, value) in &msg.headers {