Instantly share code, notes, and snippets.

View 2019-01-14 introducing-reactphp-child-process.md

Today, we're very happy to announce the immediate availability of the next major beta release of reactphp/child-process, the event-driven library for executing child processes with ReactPHP. 🎉

ReactPHP ❤️ Windows

As the main feature of this v0.6.0 release, this library now has limited Windows support and supports passing custom pipes and file descriptors to the child process. Let's look into why we think this is a major milestone for this project and how this can be used to spawn a child process to offload a blocking process in a non-blocking way with ReactPHP.

This post aims more for the "why" instead of "what" has changed. This release involves a few minor BC breaks, but we expect that most consumers of this package will actually not be affected. If you're upgrading from a previous version of this project, you may want to take a look at the changelog describing all

View 2018-01-07 introducing-tls-1-3-for-reactphp.md

Today, we're very happy to announce the immediate availability of the next v1.2.0 feature release of reactphp/socket, the async, streaming plaintext TCP/IP and secure TLS socket server and client for ReactPHP. 🎉

As the main feature of this release, this library now has improved support for secure TLS 1.3 connections for both server side connections as well as client side connections. TLS 1.3 is an official standard as of August 2018. The protocol has major improvements in the areas of security, performance, and privacy. It is an exciting protocol update that we can expect to benefit from for years to come. Not only will encrypted connections (such as HTTPS) become faster, but they will also be more secure. If you want to learn more about TLS 1.3, see also CloudFlare's excellent introduction.

As a

View 2019-01-01 2018-in-review.md

Without further ado, let me start with saying:

<?php

echo 'Happy New Year! 🎉';

Now with a fresh start, let's take a moment to review some of my highlights of the past year. In 2018…

View 2018-12-19 introducing-reactphp-ssh-proxy.md

Today, I'm happy to announce the very first stable v1.0.0 release of clue/reactphp-ssh-proxy 🎉

Async SSH proxy connector and forwarder, tunnel any TCP/IP-based protocol through an SSH server, built on top of ReactPHP.

Now that v1.0.0 has been tagged and released today, let's take a look at how we can use SSH tunnels as a powerful feature for many different use cases, how it compares to other proxy protocols and why I think @ReactPHP's design makes it a perfect fit.

SSH proxy a.k.a. SSH tunnel

Secure Shell (SSH) is a secure network protocol that is most commonly used to access a login shell on a remote server. Its architecture allows it to use multiple secure channels over a single connection. Among others, this can also be used to create an "SSH tunnel", which is commonly used to tunnel HTTP(S) traffic through an intermediary ("proxy"), to conceal the origin address (anonymity) or to

View 2018-11-28 introducing-reactphp-mysql-lazy-connections.md

Today, we're very happy to announce the immediate availability of the next major beta release of friends-of-reactphp/mysql, the async MySQL database client for ReactPHP. 🎉

Now that v0.5.0 has been tagged and released today, let's look into why we believe the new API provides significant new features that warrant a major version bump. While existing code will continue to work without changes, you're highly recommended to consider using the new lazy connections as detailed below. Alright, let's be lazy!

Eager database connections

friends-of-reactphp/mysql provides a pure PHP implementation for accessing an existing MySQL database with ReactPHP. It allows you to asynchronously connect to your database and send queries to it. Depending on your use case, you can use multiple concurrent connections or use @ReactPHP's vast ecosystem to concurrency access other servic

View 2018-11-20 introducing-reactphp-socks.md

Today, I'm happy to announce the v1.0.0 release of clue/reactphp-socks 🎉

Async SOCKS proxy connector client and server implementation, tunnel any TCP/IP-based protocol through a SOCKS5 or SOCKS4(a) proxy server, built on top of ReactPHP.

Don't be fooled by the version number: Its release history suggests this is not exactly a new project. In fact, this is the first project that got me started with @ReactPHP around six years ago (time flies by) and has been used in production in a number of projects ever since. So I guess it's about time to write an introductory blog post about this project, what SOCKS proxy servers can be used for and why I think @ReactPHP's design makes it a perfect fit.

Pull your SOCKS up

The SOCKS proxy protocol family (SOCKS5, SOCKS4 and SOCKS4a) is commonly used to tunnel HTTP(S) traffic through an intermediary ("proxy"), to conceal the origin address (anonym

View 2018-11-07 introducing-reactphp-soap.md

Today, I'm happy to announce the v1.0.0 release of clue/reactphp-soap 🎉

Simple, async SOAP web service client library, built on top of ReactPHP.

To answer the first thing you may be wondering: Yes, it is 2018 and indeed, this project has been used in production in a number of projects for a few of years already. So I guess it's about time to write an introductory blog post about this project, how SOAP requests can be used and why I think @ReactPHP's design makes it a perfect fit. Warning, terrible puns ahead.

SOAP shouldn't make you feel dirty

Most notably, SOAP is often used for invoking Remote procedure calls (RPCs) in distributed systems. Internally, SOAP messages are encoded as XML and usually sent via HTTP POST requests. Each SOAP web service may offer any number of RPC functions. These are usually defined in a public [WSDL](https://en

View 2018-10-30 introducing-reactphp-http-proxy.md

Today, I'm happy to announce the v1.4.0 release of clue/reactphp-http-proxy 🎉

Async HTTP proxy connector, use any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP.

Once again, the version number and its release history suggests this is not exactly a new project. In fact, this has been used in production in a number of projects for a couple of years already. So I guess it's about time to write an introductory blog post about this project, what HTTP CONNECT proxy servers can be used for and why I think @ReactPHP's design makes it a perfect fit.

HTTP CONNECT

HTTP CONNECT proxy servers (also commonly known as "HTTPS proxy" or "SSL proxy") are commonly used to tunnel HTTPS traffic through an intermediary ("proxy"), to conceal the origin address (anonymity) or to circumvent address blocking (geoblocking). While many (public) HTTP CONNECT proxy

View 2018-10-24 introducing-reactphp-buzz.md

Today, I'm happy to announce the v2.5.0 release of clue/reactphp-buzz 🎉

Simple, async PSR-7 HTTP client for concurrently processing any number of HTTP requests, built on top of ReactPHP.

As the version number suggests, this is not exactly a new project. In fact, this has been used in production in a larger number of projects for a few years already. So I guess it's about time to write an introductory blog post about this project, why async HTTP requests are such a powerful feature and also a bit about the motivation for this project and why I think @ReactPHP is a perfect fit for sending HTTP requests.

HTTP all the things!

I'm probably not telling you something new when I say the web is built on top of HTTP. This blog post is served over HTTP. Your YouTube videos are served over HTTP. Your downloads are served over HTTP. RESTful backend APIs are served over HTTP. GraphQL APIs are served over HTTP. SOAP APIs are served over HTTP. Yes,

View 2018-09-21 introducing-reactphp-mysql.md

Today, we're very happy to announce the immediate availability of the next major beta release of friends-of-reactphp/mysql, the async MySQL database client for ReactPHP. 🎉

Now that v0.4.0 has been tagged and released today, let's look into why I think this is not only a major milestone for this project, but could also possibly be a game changer in how people use databases with ReactPHP and eventually maybe with PHP in general.

This post aims more for the "why" instead of "what" has changed. If you're upgrading from a previous version of this project, you may want to take a look at the changelog describing all the changes in greater detail. Alright, so let's dive right in.

Promise all the things!

Originally, this project was maintained by Jin Hu who did an excellent job figuring out all the protocol details and building an API that can be cons