Server IP : 85.214.239.14 / Your IP : 18.191.171.72 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/cwd/proc/2/root/proc/2/root/proc/3/cwd/usr/share/doc/uwsgi-core/examples/rack/ |
Upload File : |
require 'fiber' class SuspendingBody def each for i in 1..3 yield "number: #{i}\n" UWSGI.async_sleep(1) puts "sleep..." Fiber.yield end fd = UWSGI.async_connect("81.174.68.52:80") UWSGI.wait_fd_write(fd, 3) Fiber.yield io = IO.new(fd) puts "connected" io.syswrite("GET /uwsgi/export/1081%3A362d695b2f25/plugins/fiber/fiber.c HTTP/1.0\r\n") io.syswrite("Host: projects.unbit.it\r\n") io.syswrite("\r\n") UWSGI.wait_fd_read(fd, 3) Fiber.yield puts "data available" begin while body = io.sysread(fd) yield body Fiber.yield end rescue end io.close end end class RackFoo def call(env) [200, { 'Content-Type' => 'text/plain'}, SuspendingBody.new] end end run RackFoo.new