title: CSRF Token mismatch with Laravel-Echo-Server and Homestead
body: <p>I'm trying to setup the broadcast system of Laravel, but I have an issue with the CSRF Token.</p>
  
  <p>I send the token to my SPA</p>
  
  <pre><code>&lt;meta name="csrf-token" content="{{ csrf_token() }}"&gt;
  </code></pre>
  
  <p>then I setup my options for Laravel-Echo</p>
  
  <pre><code>window.Echo = new Echo({
      broadcaster: 'socket.io',
      host: window.location.hostname + ':6001',
      csrfToken: document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
      auth:
      {
          headers:
          {
              'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
          }
      }
  });
  </code></pre>
  
  <p>I check the Echo object, and the CRSF token is present. But when I watch Laravel-Echo-Server logs, there is a 419 error response (CRSF Token Mismatch)</p>
  
  <p>Laravel-Echo-Server is running on the same vagrant machine (Homestead) and I use a the faked hostname "<a href="http://developing.com" rel="nofollow noreferrer">http://developing.com</a>" on port 80 on hosting PC to access the http server. Here my laravel-echo-server.json</p>
  
  <pre><code>{
  "authHost": "http://developing.com",
  "authEndpoint": "/broadcasting/auth",
  "clients": [
      {
          "appId": "...",
          "key": "..."
      }
  ],
  "database": "redis",
  "databaseConfig": {
      "redis": {},
      "sqlite": {
          "databasePath": "/database/laravel-echo-server.sqlite"
      }
  },
  "devMode": true,
  "host": null,
  "port": "6001",
  "protocol": "http",
  "socketio": {},
  "secureOptions": 67108864,
  "sslCertPath": "",
  "sslKeyPath": "",
  "sslCertChainPath": "",
  "sslPassphrase": "",
  "subscribers": {
      "http": true,
      "redis": true
  },
  "apiOriginAllow": {
      "allowCors": false,
      "allowOrigin": "",
      "allowMethods": "",
      "allowHeaders": ""
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Where am I wrong ?
  Thanks you !</p>
  
  <p><strong>UPDATE</strong>
  I don't have anymore the issue... Maybe the dump-autoload did something ? I don't know...</p>