title: How can I create a web::uri from a string to put into client.connect()?
body: <p>A <code>client.connect(web::uri)</code> is required, but after looking into <code>web::uri</code> it won't accept a string. The api seems to say it can accept a string, but it won't and I can't figure out why.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include &lt;cpprest/ws_client.h&gt;
  
  using namespace std;
  using namespace web;
  using namespace web::websockets::client;
  
  int main(int argc, char **args) {
  
      uri link = uri("ws://echo.websocket.org"); //PROBLEM LINE
      websocket_client client;    
      client.connect(link).wait(); 
  
      websocket_outgoing_message out_msg;
      out_msg.set_utf8_message("test");
      client.send(out_msg).wait();
  
      client.receive().then([](websocket_incoming_message in_msg) {
          return in_msg.extract_string();
      }).then([](string body) {
          cout &lt;&lt; body &lt;&lt; endl;
      }).wait();
  
      client.close().wait();
  
      return 0;
  }
  </code></pre>