title: Socket.io and Angular 2
body: <p>I'm trying to use <code>Socket.io-client</code> library in Angular 2 app. </p>
  
  <p>There are tons of different guides related to fast changes that Angular 2 have in a past couple of months. </p>
  
  <p>I don't know do I doing something wrong.</p>
  
  <p>What I did?</p>
  
  <pre><code>npm install socket.io-client --save
  </code></pre>
  
  <p>After that in component:</p>
  
  <pre><code>...
  
  import * as io from "socket.io-client";
  ...
  
  export class MyComponent implements OnInit {
  
  socket: SocketIOClient.Socket;
  
  constructor() {
  
      this.socket = io.connect("http://localhost:4200");
      this.socket.on("connection", () =&gt; console.log("this is onl a test"));
  
    }
  }
  
  }
  </code></pre>
  
  <p>When I open console I see following errors:</p>
  
  <pre><code>  GET http://localhost:4200/socket.io/?EIO=3&amp;transport=polling&amp;t=LdBXte5 404 (Not Found)
  </code></pre>