Slide 1

Slide 1 text

Building a WebSockets server in PHP

Slide 2

Slide 2 text

Freek Van der Herten Partner & developer at SPATIE @freekmurze https://spatie.be https://ohdearapp.com https://fullstackeurope.com https://murze.be

Slide 3

Slide 3 text

Open source software

Slide 4

Slide 4 text

https://spatie.be/open-source

Slide 5

Slide 5 text

Some statistics on our open source work ± 200 public repositories on GitHub August 2016: ± 800 000 downloads August 2017: ± 5 000 000 downloads August 2018: ± 17 000 000 downloads January 2019: ± 25 000 000 downloads ± 1 800 000 downloads a month https://murze.be/the-story-behind-our-open-source-efforts

Slide 6

Slide 6 text

Postcardware

Slide 7

Slide 7 text

Spatie
 Samberstraat 69D
 2060 Antwerp
 Belgium


Slide 8

Slide 8 text

https://spatie.be/open-source/postcards

Slide 9

Slide 9 text

https://spatie.be/vacancies/backend-developer

Slide 10

Slide 10 text

Let's talk 
 WebSockets

Slide 11

Slide 11 text

WebSockets A long-held single TCP socket connection Bi directional messages between client and super Crazy fast Used for real time interactions

Slide 12

Slide 12 text

WebSockets in PHP Ratchet Build upon ReactPHP Very powerful Some setup required

Slide 13

Slide 13 text

Broadcasting in Laravel Native support Driver based Laravel Echo Pusher / Laravel Echo Server

Slide 14

Slide 14 text

laravel-websockets Package created by Marcel Pociot and me WebSockets server built on top of Ratchet Takes care of channels and authentication Fully compatible with Laravel and Laravel Echo Pusher protocol

Slide 15

Slide 15 text

https://docs.beyondco.de/laravel-websockets

Slide 16

Slide 16 text

Does it scale?

Slide 17

Slide 17 text

Wrapping up

Slide 18

Slide 18 text

Resources https://docs.beyondco.de/laravel-websockets/
 
 https://murze.be/introducing-laravel-websockets-an-easy-to-use- websocket-server-implemented-in-php
 
 https://laravel.com/docs/5.7/broadcasting
 
 https://pusher.com/docs/pusher_protocol


Slide 19

Slide 19 text

Thank you! Freek Van der Herten Partner & developer at SPATIE https://spatie.be/open-source https://ohdearapp.com https://murze.be