Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Websockets in PHP using Swoole

Websockets in PHP using Swoole

Avatar for Ricardo Coelho

Ricardo Coelho

August 19, 2022
Tweet

More Decks by Ricardo Coelho

Other Decks in Programming

Transcript

  1. Agenda Websockets & HTTP/1.1 Ratchet & Swoole Concurrency, asynchrony &

    parallelism Multithread, fi bers & coroutines Shared memory & semaphores Streams, gRPC, protobuf, HTTP/2, HTTP/3 & QUIC
  2. FROM php:8.1.9 RUN apt-get update \ && apt-get install -y

    libssl-dev git zip wget \ && cd /tmp \ && wget https://github.com/swoole/swoole-src/archive/refs/heads/master.zip -O swoole-src.zip \ && unzip swoole-src.zip && cd swoole-src-master \ && phpize && ./configure && make && make install \ && cd / && rm -rf /tmp/pear \ && docker-php-ext-install sockets \ && docker-php-ext-enable swoole sockets nexy/swoole:8.1.9
  3. “Respect the past, and prepare for the future by taking

    action in the present.” Rob Martin
  4. References • https://www.rfc-editor.org/rfc/rfc6455 • https://datatracker.ietf.org/doc/html/rfc9000 • https://www.rfc-editor.org/rfc/rfc7540.html • https://datatracker.ietf.org/doc/html/rfc9114 •

    https://unsplash.com • http://socketo.me • https://openswoole.com • https://speakerdeck.com/ramcoelho/swoole • https://github.com/nexy/swoole The WebSocket Protocol QUIC: A UDP-Based Multiplexed and Secure Transport Hypertext Transfer Protocol Version 2 (HTTP/2) HTTP/3 Images Ratchet Websockets Open Swoole These slides Code used in these slides