{"action":"opened","issue":{"url":"https://api.github.com/repos/housleyjk/ws-rs/issues/26","repository_url":"https://api.github.com/repos/housleyjk/ws-rs","labels_url":"https://api.github.com/repos/housleyjk/ws-rs/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/housleyjk/ws-rs/issues/26/comments","events_url":"https://api.github.com/repos/housleyjk/ws-rs/issues/26/events","html_url":"https://github.com/housleyjk/ws-rs/issues/26","id":133677558,"number":26,"title":"Different behaviour ws:// vs wss:// on refuse connection","user":{"login":"vird","id":1259866,"avatar_url":"https://avatars.githubusercontent.com/u/1259866?v=3","gravatar_id":"","url":"https://api.github.com/users/vird","html_url":"https://github.com/vird","followers_url":"https://api.github.com/users/vird/followers","following_url":"https://api.github.com/users/vird/following{/other_user}","gists_url":"https://api.github.com/users/vird/gists{/gist_id}","starred_url":"https://api.github.com/users/vird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vird/subscriptions","organizations_url":"https://api.github.com/users/vird/orgs","repos_url":"https://api.github.com/users/vird/repos","events_url":"https://api.github.com/users/vird/events{/privacy}","received_events_url":"https://api.github.com/users/vird/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-15T10:27:55Z","updated_at":"2016-02-15T10:27:55Z","closed_at":null,"body":"I have no server on port 3012.\r\n\r\n    extern crate ws;\r\n    extern crate env_logger;\r\n\r\n    fn main() {\r\n      env_logger::init().unwrap();\r\n\r\n      let bind_addr = \"0.0.0.0:3012\";\r\n      println!(\"START\");\r\n      if let Err(_) = ws::connect(format!(\"ws://{}\", bind_addr), |out| {\r\n        if let Err(_) = out.send(\"killprev\") {\r\n          println!(\"Fail to send killprev.\")\r\n        };\r\n        move |_msg| {\r\n          out.close(ws::CloseCode::Normal)\r\n        }\r\n      }) {\r\n        println!(\"no ws listen\");\r\n      };\r\n      println!(\"MIDDLE\");\r\n      if let Err(_) = ws::connect(format!(\"wss://{}\", bind_addr), |out| {\r\n        if let Err(_) = out.send(\"killprev\") {\r\n          println!(\"Fail to send killprev.\")\r\n        };\r\n        move |_msg| {\r\n          out.close(ws::CloseCode::Normal)\r\n        }\r\n      }) {\r\n        println!(\"no wss listen\");\r\n      };\r\n      println!(\"END\");\r\n    } \r\n\r\nCargo.toml\r\n\r\n    [dependencies]\r\n    env_logger = \"0.3.2\"\r\n\r\n    [dependencies.ws]\r\n    features = [\"ssl\"]\r\n    git = \"https://github.com/housleyjk/ws-rs\" \r\n\r\n\r\nI expect messages \"MIDDLE\" and \"END\"\r\nresult:\r\n\r\n    START\r\n    ERROR:ws::handler: WS Error <Io(Error { repr: Os { code: 111, message: \"Connection refused\" } })>\r\n    MIDDLE\r\n    ERROR:ws::io: Unable to establish connection to wss://0.0.0.0:3012/: WS Error <Ssl(StreamError(Error { repr: Os { code: 111, message: \"Connection refused\" } }))>\r\n    ERROR:ws::handler: WS Error <Io(Error { repr: Os { code: 2, message: \"No such file or directory\" } })>\r\n"}}