Skip to content

Commit

Permalink
minor: add proxy config
Browse files Browse the repository at this point in the history
  • Loading branch information
jinrenjie committed May 28, 2020
1 parent ed58bc5 commit 3e7bfb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_REDIRECT=

PROXY_TYPE=socks5h
PROXY_PORT=1080
PROXY_SERVER=127.0.0.1

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Auth/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ public function issue(Request $request)

switch ($params['platform']) {
case 'Google':
$address = sprintf('%s://%s:%s', config('proxy.type'), config('proxy.server'), config('proxy.port'));
$httpClient = new Client([
'proxy' => 'socks5h://127.0.0.1:1080',
'proxy' => $address,
'verify' => false
]);
$client = new Google_Client(['client_id' => config('services.google.client_id')]);
Expand Down
7 changes: 7 additions & 0 deletions config/proxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

return [
'type' => env('PROXY_TYPE'),
'port' => env('PROXY_PORT'),
'server' => env('PROXY_SERVER')
];

0 comments on commit 3e7bfb3

Please sign in to comment.