title: how write socket server in laravel?
body: <p>i wrote a code in php that make a socket server and it worked:</p>
  
  <pre><code>&lt;?php
  
  $host = "127.0.0.1";
  $port = 25003;
  set_time_limit(0);
  $socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create socket\n");
  $result = socket_bind($socket, $host, $port) or die("Could not bind to socket\n");
  $result = socket_listen($socket, 3) or die("Could not set up socket listener\n");
  
  $spawn = socket_accept($socket) or die("Could not accept incoming connection\n");
  $input = socket_read($spawn, 1024) or die("Could not read input\n");
  $input = trim($input);
  echo "Client Message : ".$input;
  $output = strrev($input) . "\n";
  socket_write($spawn, $output, strlen ($output)) or die("Could not write output\n");
  socket_close($spawn);
  socket_close($socket);
  ?&gt;
  </code></pre>
  
  <p>then i moved that code in a laravel controller. like this:</p>
  
  <pre><code>class HomeController extends Controller
  {     
      function socket_server()
      {
          // code above
      }
  }
  </code></pre>
  
  <p>but i get this error:</p>
  
  <pre><code>socket_create() has been disabled for security reasons
  </code></pre>
  
  <p>how i can write socket server in laravel?</p>