File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ class RemoteLRS implements LRSInterface
3232 protected $ endpoint ;
3333 protected $ version ;
3434 protected $ auth ;
35+ protected $ proxy ;
36+ protected $ headers ;
3537 protected $ extended ;
3638
3739 public function __construct () {
@@ -100,6 +102,15 @@ protected function sendRequest($method, $resource) {
100102 if (isset ($ this ->auth )) {
101103 array_push ($ http ['header ' ], 'Authorization: ' . $ this ->auth );
102104 }
105+ if (isset ($ this ->proxy )) {
106+ $ http ['proxy ' ] = $ this ->proxy ;
107+ }
108+
109+ if (isset ($ this ->headers ) && count ($ this ->headers ) > 0 ) {
110+ foreach ($ this ->headers as $ k => $ v ) {
111+ array_push ($ http ['header ' ], "$ k: $ v " );
112+ }
113+ }
103114
104115 if (isset ($ options ['headers ' ])) {
105116 foreach ($ options ['headers ' ] as $ k => $ v ) {
@@ -1169,4 +1180,16 @@ public function setAuth() {
11691180 return $ this ;
11701181 }
11711182 public function getAuth () { return $ this ->auth ; }
1183+
1184+ public function setProxy ($ value ) {
1185+ $ this ->proxy = $ value ;
1186+ return $ this ;
1187+ }
1188+ public function getProxy () { return $ this ->proxy ; }
1189+
1190+ public function setHeaders ($ value ) {
1191+ $ this ->headers = $ value ;
1192+ return $ this ;
1193+ }
1194+ public function getHeaders () { return $ this ->headers ; }
11721195}
You can’t perform that action at this time.
0 commit comments