1 | <?php |
||
16 | class Connection_properties_injector implements HttpServerInterface { |
||
17 | private $delegate; |
||
18 | /** |
||
19 | * @inheritdoc |
||
20 | */ |
||
21 | public function __construct (HttpServerInterface $delegate) { |
||
24 | /** |
||
25 | * @inheritdoc |
||
26 | */ |
||
27 | public function onOpen (ConnectionInterface $conn, RequestInterface $request = null) { |
||
49 | /** |
||
50 | * The best guessed IP of client (based on all known headers), `127.0.0.1` by default |
||
51 | * |
||
52 | * @param string[] $source_ips |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | protected function ip ($source_ips) { |
||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function onMessage (ConnectionInterface $from, $msg) { |
||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function onClose (ConnectionInterface $conn) { |
||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function onError (ConnectionInterface $conn, \Exception $e) { |
||
83 | } |
||
84 |