The documentation only mention handling url from http://localhost
Using this code:
$http = new swoole_http_server("127.0.0.1", 9501);
$http->on('request', function ($request, $response) {
$response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>");
});
$http->start();
How could swoole handle a different url. Suppose: http://localhost/otherpage
You can start with some inspectation to check it out
var_dump($request)
Try the same for $response and $http in your case to get an overview :)
@jobs-git have you some success? :blush:
$http->on('request', function ($req, $resp) {
$uri = $req->server['request_uri'];
if ($uri == '/favicon.ico') {
$req->status(404);
$req->end();
}
elseif ($uri == '/chunk') {
chunk($req, $resp);
} else {
no_chunk($req, $resp);
}
});