Search by

microweber-packages / microweber-http

boksiora

Standalone Laravel HTTP client package with Guzzle/cURL adapters, SSL enforcement, SSRF guard and URL fetch guard

Package info

github.com/microweber-packages/microweber-http

Homepage

pkg:composer/microweber-packages/microweber-http

Statistics

Installs: 34

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-03 11:17 UTC

This package is auto-updated.

Last update: 2026-11-03 17:06:50 UTC


README

A standalone Laravel HTTP client package with Guzzle/cURL adapters, SSL enforcement, SSRF guard, and URL fetch guard.

Installation

composer require microweber-packages/microweber-http

Usage

Via Service Container

// Resolve via the container
$http = app('http');
$body = $http->url('https://example.com/api')->get();

HttpClientFactory

use MicroweberPackages\Http\HttpClientFactory;

// Create a Guzzle client with SSL verification
$client = HttpClientFactory::guzzle(['timeout' => 30]);

// Create a secure cURL handle
$ch = HttpClientFactory::curl('https://example.com');

// Fetch content
$content = HttpClientFactory::fetchContent('https://example.com/file.zip');

SSRF Guard

use MicroweberPackages\Http\Ssrf\SsrfGuard;

if (SsrfGuard::isExternallyReachable($url)) {
    // Safe to fetch
}

URL Fetch Guard

use MicroweberPackages\Http\UrlFetchGuard;

UrlFetchGuard::assertSafe($userSuppliedUrl);

License

MIT