Skip to content

Commit 762ba0f

Browse files
committed
feat: http proxy
1 parent 35bb2cb commit 762ba0f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/Providers/MarketServiceProvider.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,20 @@ public function microMarketHttp()
6666
}
6767

6868
Http::macro('market', function () {
69-
return Http::baseUrl(config('app.url'))->withHeaders([
70-
'accept' => 'application/json',
71-
]);
69+
$httpProxy = config('app.http_proxy');
70+
71+
$http = Http::baseUrl(config('app.url'))
72+
->withHeaders([
73+
'accept' => 'application/json',
74+
])
75+
->withOptions([
76+
'proxy' => [
77+
'http' => $httpProxy,
78+
'https' => $httpProxy,
79+
],
80+
]);
81+
82+
return $http;
7283
});
7384
}
7485
}

0 commit comments

Comments
 (0)