Download the PHP package filippo-toso/wireguard-transport without Composer

On this page you can find all versions of the php package filippo-toso/wireguard-transport. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wireguard-transport

WireGuard Transport

A PSR-18 HTTP client that sends those requests through a WireGuard tunnel.

The handshake, encryption, and TCP stack live in this process. Other programs keep the host's normal routes. Nothing here needs root, a TUN device, or a separate WireGuard binary.

Third-party libraries can depend on this package and pass any PSR-7 request to sendRequest(). filippo-toso/wireguard-http and filippo-toso/wireguard-proxy are built on it.

Requirements

Install

Usage

withConfig() accepts the configuration text instead of a file.

sendRequest() returns the next HTTP response and does not follow redirects. Call withFollowRedirects(true) when this client should follow them. withTimeout(), withConnectTimeout(), and withVerify(false) adjust that one call and share the same tunnel.

Hostnames in request URLs are resolved inside the tunnel, using the DNS addresses from the configuration. The WireGuard endpoint hostname is resolved on the host, because that UDP socket is how the tunnel itself is reached.

A failed network call throws FilippoToso\WireguardTransport\Exception\NetworkException, which is a PSR-18 network exception. A request this client cannot send, such as a URL that is not absolute http(s), throws InvalidRequestException. A disconnected tunnel throws TunnelException. All three implement Psr\Http\Client\ClientExceptionInterface.

Configuration files

Pass a normal wg-quick file: one [Interface] and at least one [Peer], including PrivateKey, Address, PublicKey, AllowedIPs, and Endpoint. Repeated Address, DNS, and AllowedIPs lines are joined. A bare IP is treated as /32 or /128. DNS, MTU, ListenPort, PresharedKey, and PersistentKeepalive are kept. DNS search domains are ignored. Table, FwMark, SaveConfig, and the PreUp / PostUp / PreDown / PostDown hooks are accepted and ignored, because this process does not run shell hooks. CheckAlive and CheckAliveInterval are accepted and ignored.

A key may be an environment-variable reference such as $WG_PRIVATE_KEY or ${WG_PUBLIC_KEY}. The variable is read when the tunnel starts.

disconnect() drops the session. Further requests on that client fail. The tunnel also stops when the last client using it is destroyed.

Limitations


All versions of wireguard-transport with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-openssl Version *
ext-sodium Version *
guzzlehttp/psr7 Version ^2.6
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package filippo-toso/wireguard-transport contains the following files

Loading the files please wait ...