Non-blocking socket and TLS functionality for PHP based on Amp.
Full Changelog: https://github.com/amphp/socket/compare/v2.3.0...v2.3.1
Full Changelog: https://github.com/amphp/socket/compare/v1.2.0...v1.2.1
Socks5SocketConnector
to connect to hosts via SOCKS5 proxies. A similar implementation was previously present in amphp/http-tunnel
.stream_context_set_option()
, which was causing a deprecation notice on PHP 8.3.Full Changelog: https://github.com/amphp/socket/compare/v2.2.3...v2.2.4
stream_context_set_option()
on PHP 8.3.Full Changelog: https://github.com/amphp/socket/compare/v2.2.2...v2.2.3
DnsSocketConnector
( #108).Full Changelog: https://github.com/amphp/socket/compare/v2.2.1...v2.2.2
ResourceUdpSocket
to match the maximum UDP payload length.Full Changelog: https://github.com/amphp/socket/compare/v2.2.0...v2.2.1
league/uri
7.x$socket
in example by @61-6c-69 in https://github.com/amphp/socket/pull/106
Full Changelog: https://github.com/amphp/socket/compare/v2.1.0...v2.2.0
InternetAddress::tryFromString()
by @trowski in https://github.com/amphp/socket/pull/105
CidrMatcher
by @kelunikFull Changelog: https://github.com/amphp/socket/compare/v2.0.0...v2.1.0
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType>
have been replaced with ResolutionType
.
See some of the changes in v2.0
of amphp/byte-stream
since this library extends several of the interfaces in that library, particularly ReadableStream
and WritableStream
.
EncryptableSocket
interface to Socket
and removed EncryptableSocket
SocketAddress
to an interface with two implementations: InternetAddress
and UnixAddress
SocketAddress::getType()
, which returns an enum SocketAddressType
with cases Unix
and Internet
SocketAddress
static constructors have been relocated as functions in the Amp\Socket\SocketAddress
namespace.connectTls
functionbindUdpSocket
functionResourceUdpSocket
and UdpSocket
interfaceServerSocketFactory
interface for creating ServerSocket
instances along with an implementation ResourceServerSocketFactory
createPair
function to createSocketPair
connector
to socketConnector
Server
to ResourceServerSocket
and introduced ServerSocket
interface
ResourceServerSocket::__construct()
requires a BindContext
instanceConnector
to SocketConnector
DnsConnector
to DnsSocketConnector
StaticConnector
to StaticSocketConnector
BindContext
, use chunk size parameters on listen
/ bindUdpSocket
insteadConnectContext
in favor of a constructor parameter to RetrySocketConnector
DnsSocketConnector
now tries each host returned from a DNS query a single time before failing. Retrying the list is accomplished through a new connector implementation, RetrySocketConnector
that can be configured to retry a given number of times with an exponential backoff between attempts.EncryptableSocket
interface to Socket
and removed EncryptableSocket
SocketServer
to ServerSocket
SocketServerFactory
to ServerSocketFactory