Giter VIP home page Giter VIP logo

php-proxy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-proxy's Issues

Zend\Diactoros\Response\SapiEmitter has been depricated

Zend\HttpHandlerRunner\Emitter\SapiEmitter is the replacement for the deprecated class. As a part of updating this, you will need to remove the use of "zendframework/zend-diactoros": "^1.0 || ^2.0", and update it with "zendframework/zend-httphandlerrunner": "^1.1"

Filter HLS-Streams

Hello,

I'm not a developer, maybe someone could help me.

I transfer some HLS-streams from the Internet to my Smart-TV via xupnpd2 media-server (installed on the router).

I try to use HLS-streams from Skyline (e.g. http://www.skylinewebcams.com/de/webcam/czech-republic/prague/prague/old-town-bridge-tower.html). Unfortunately, xupnpd2 doesn't support https and has no proxy-server support. But the m3u8-playlist and the .ts-files are also available via http.

Is it possible to use this php-proxy to replace the .ts-URLs in the m3u8-playlist from https to http?

Is it also possible to send additional HTTP-headers to receive the m3u8-playlist from the provider Earthcam (e.g. http://www.earthtv.com/en/webcam/prag-karlsbruecke)?

Thanks and best regards,
Thomas

Problems with gzip and content-length

Hi,

I am testing this proxy for a usability-testing usecase, where I change the content of some websites for some of my probands. I had two small issues:

  1. One tested website supports gzip-compression, but the proxy fails to handle it properly. I solved this for me by adding "Accept-Encoding" to the stripped headers in the set_request_headers()-method.
  2. When I change the content of the way to the client, its length changes. So I had to add "Content-Length" to the stripped headers in the set_response_headers()-method. My dispatcher-script readds this header later, but it works also without this header.

Just wanted to let others know about my workarounds. The gzip-thing maybe a good default.

Problems with POST and forms

I'm trying to use this proxy to forward requests to an ASP.NET server on another domain. When I send a login request (POST to /api/login, request body containing a form) directly to the ASP.NET server it works fine, but when it has passed through the proxy I get an exception:

System.IO.IOException: Unexpected end of Stream, the content may have already been read by another component.

This exception occurs when I attempt to read the form from the request body.

I'm running the proxy with the default setup as provided in the readme file. Do I need to do something special to have the proxy include the forms in the proxied requests?

Trust self signed https certificate

Hello,

I'm trying to create a Proxy for an API which runs on a development computer. I'm facing the problem that I don't know how to tell the proxy to accept a self-signed SSL certificate.

This is the error I get:
Fatal error: Uncaught exception 'GuzzleHttp\Ring\Exception\RingException' with message 'cURL error 60: See http://curl.haxx.se/libcurl/c/libcurl-errors.html' in /work/php_proxy/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 51

here's my index.php:

use Proxy\Adapter\Guzzle\GuzzleAdapter;
use Proxy\Proxy;
use Symfony\Component\HttpFoundation\Request;

require '../vendor/autoload.php';


// Create a Symfony request based on the current browser request.
$request = Request::createFromGlobals();
// Create a guzzle client
$guzzle = new GuzzleHttp\Client;
$guzzle->setDefaultOption('verify', false);

// Create the proxy instance
$proxy = new Proxy(new GuzzleAdapter($guzzle));
// Forward the request and get the response.
$response = $proxy->forward($request)->to(urldecode($request->query->get('url')));

// Output response to the browser.
$response->send();

As stated in the guzzle docs, there's an option to trust self-signed certificates, but I dont know where to implement it.
I tried it with the line

$guzzle->setDefaultOption('verify', false);

but it had no effect.

I'm using php-proxy v2.2.1, guzzle 5.0.

stress test exception!!

we have a stress test about this. And there is a problem we receive many request come from myself when request numbers reach a critical value.

Transfer http code as destination server

Hi, I have custom http codes (can be 2XX, 5XX, 6XX, ...) in the destination server.
I would like to keep the http code exactly as destination server ; on proxy side I get always 500 errors with this stack trace :

[09-Jan-2016 11:30:55 Europe/Berlin] PHP Fatal error:  Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `POST https://mydomain.com/BLAHBLAH/services/` resulted in a `417 Expectation Failed` response:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "htt (truncated...)
' in /Library/WebServer/Documents/BLAHBLAH/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:107
Stack trace:
#0 /Library/WebServer/Documents/BLAHBLAH/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(Zend\Diactoros\ServerRequest), Object(GuzzleHttp\Psr7\Response))
#1 /Library/WebServer/Documents/BLAHBLAH/vendor/guzzlehttp/promises/src/Promise.php(199): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /Library/WebServer/Documents/BLAHBLAH/vendor/guzzlehttp/promises/src/Promise.php(152): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 /Library/WebSe in /Library/WebServer/Documents/BLAHBLAH/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 107

Could it be possible ?

expose guzzle/adapter object to set cURL options

I doing some work with php-proxy and run into a situation where I'd like to have access to the guzzle instance. It would work if Factory::createAdapter is public in which case I could create the adapter myself and then call the proxy constructor. Not really factory like, but it would work.

The only way right now is to create class derived from GuzzleAdapter and instantiate that and then pass that along into Factory::create

Any ideas / suggestions? I would create a pull request if we can agree on a way to implement that..

problem with files upload

Hi,

when I try to upload files, these are not available on the forwarded to site. Is there known any problem with this?

thanks
MarekL

Post+params+redirect = errorRuntimeException

POST /proxy/headertest.php HTTP/1.1
Expect: 100-Continue
content-type: application/x-www-form-urlencoded; charset=UTF-8
connection: Keep-Alive
user-agent: Apache-HttpClient/4.4.1 (Java/1.8.0_51)
accept-encoding: gzip,deflate
Host: localhost
Content-Length: 22

HTTP/1.1 100 Continue

testvariable=testvalueHTTP/1.1 302 Found
Date: Mon, 18 Apr 2016 14:24:19 GMT
Server: Apache/2.4.7 (Ubuntu)
X-Powered-By: PHP/5.5.9-1ubuntu4.14
Location: location.php
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8

Does not work with PHP 5.6

Basically this is not working at all, at least with PHP 5.6.
I'm using the samples right from the README file, without any success.

There are (at least) two problems in the request to the remote server.

  1. Transfer-Encoding: chunked (even for GET request) -- but there is no chunk following, hence the remote server is waiting until timeout.
  2. Connection: keep-alive -- the remote servers sends the response, the connection is kept alive, but the proxy doesn't forward the response to the client (browser).

I tested using version 3.0.0.

How to edit response content with filter?

Hi,

i tried to make some filter response to change the content, but i'm always get non well-formed character like this

image

And this is my code, i use dump() for debug purpose

class ModifyContent implements ResponseFilterInterface
{
    public function filter(Response $response)
    {
        dump($response->getContent());

        // $crawler = HtmlPageCrawler::create($response->getContent());

        // $response->setContent($crawler);

        return $response;
    }
}

Any idea how can i able to parsing content with some crawler/selector, modify it, and setContent() back ?

Thanks

Passes on path

Let's say I have this online at http://example.com/proxy and I'm using this to forward to http://api.com/api. When I make a JavaScript fetch request to http://example.com/proxy, the proxy ultimately requests http://api.com/api/proxy, resulting in a 404. Is there some sort of filtering that I should be doing to prevent this path from being appended?

I'm not doing much beyond the example in the readme.

Caching resources - jpg / fonts etc.

is there a middleware i could use to save the remote resources locally in the same relative path, like fonts and pictures, so .htaccess won't rewrite to the proxy.php if it founds the resources locally.
Thank you

Response emitter not working.

I try the dev-master branch (latest commit of the time of this posting). These are the last lines of my script:

// Forward the request and get the response.
$response = $proxy->forward($request)->to('http://server.com:80');
//echo (string) $response->getBody(); die();
// Output response to the browser.
(new Zend\Diactoros\Response\SapiEmitter)->emit($response);

Nothing appears from the response in the browser, if i uncomment the echo statement i can see the html rendered (website appears without css and images in this case).

HTTP/2 to HTTP/1.1

Is there a way to specify HTTP protocol version? I have HTTP/2 over SSL going to a server on the backend that doesn't support HTTP/2. This causes a 505 HTTP Version Not Supported.

I see that there is way to do it in Guzzle like:

$request = $client->request('GET', '/get', ['version' => 1.0]);

A few questions

Hey, i am currently testing your lib and planning to write some unittests. To fully understand the feature set it would be great if you could explain your intentions behind these features:

  • Why the location rewrite feature and whats the benefit?
  • Why do you remove the transfer-encoding and content-encoding headers from the response?

Thank you!

Call to undefined method Proxy\\Proxy::filter()

After downloading and installing via composer and using the first example on, I am getting this error:

Call to undefined method Proxy\\Proxy::filter() 

on this line:

$proxy->filter(new RemoveEncodingFilter());

Current demo code requires more libraries

The demo code for the current unstable version in the README does not work without an extra class library, Zend\Diactoros\ServerRequestFactory. Is it OK to send a PR to fix up the docs?

It just needs something like this in the appropriate place:

composer require zendframework/zend-diactoros

Cannot get response code for some occasions

Is there any way to get status code before output the html as for response? I need to get status code before desplay html page.example I dont need to display unauthorized html page instead I need to filter response code and re-authorized.I tried with response->getStatusCode().this works when there is success response but not for any other http status code,Handling this kind of situation was easy with prior versions.

Not working with laravel 5.3

Can you please update the dependencies as it is not working with laravel

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install jenssegers/proxy v2.2.1
    - Conclusion: remove symfony/http-foundation v3.0.2
    - Installation request for jenssegers/proxy ^2.2 -> satisfiable by jenssegers/proxy[v2.2.0, v2.2.1].
    - Conclusion: don't install symfony/http-foundation v3.0.2
    - jenssegers/proxy v2.2.0 requires symfony/http-foundation ~2.6 -> satisfiable by symfony/http-foundation[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.13, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
    - Can only install one of: symfony/http-foundation[v2.8.0, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.1, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.10, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.11, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.12, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.2, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.3, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.4, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.5, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.6, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.7, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.8, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.8.9, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.0, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.1, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.10, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.11, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.12, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.13, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.2, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.3, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.4, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.5, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.6, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.7, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.8, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.6.9, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.0, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.1, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.10, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.11, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.12, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.13, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.14, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.15, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.16, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.17, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.18, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.19, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.2, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.3, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.4, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.5, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.6, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.7, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.8, v3.0.2].
    - Can only install one of: symfony/http-foundation[v2.7.9, v3.0.2].
    - Installation request for symfony/http-foundation (locked at v3.0.2) -> satisfiable by symfony/http-foundation[v3.0.2].


Installation failed, reverting ./composer.json to its original content.

Redirect MJPG

Hey, this lib is great and allows me to save lot of time today !
However, I would like to redirect my MJPG flow through PHP Proxy. As the stream is continous end neverended, is it possible to flush the output ?

Site with JS login returns 401

(I'm trying to use this to create a slightly more secure way of accessing an IP phone from the web. The proxy code is behind a login page. The problem is that the IP phone's interface has a login using JS. php-proxy seems to ignore this or something similar, as I see in the logs it just returns a 401 error without prompting on the web page. This is my code (changed a little):

<?php

include('php/sessip.php');

$home = '/srv/homepage';

require $home . '/vendor/autoload.php';

use Proxy\Proxy;
use Proxy\Adapter\Guzzle\GuzzleAdapter;
use Proxy\Filter\RemoveEncodingFilter;
use Zend\Diactoros\ServerRequestFactory;

// Create a PSR7 request based on the current browser request.
//$request = ServerRequestFactory::fromGlobals();
$request = new Zend\Diactoros\Request('http://192.168.254.220:80', 'GET');

// Create a guzzle client
$guzzle = new GuzzleHttp\Client();

// Create the proxy instance
$proxy = new Proxy(new GuzzleAdapter($guzzle));

// Add a response filter that removes the encoding headers.
$proxy->filter(new RemoveEncodingFilter());

// Forward the request and get the response.
$response = $proxy->forward($request)->to('http://192.168.254.220/');

// Output response to the browser.
(new Zend\Diactoros\Response\SapiEmitter)->emit($response);)

100% cpu spike.

I'm using php-proxy to a node server which just returns HTML with very low latency, and I've been getting 100% cpu spikes from php-cgi. Could this be related to the proxy / guzzle / curl implementation?

Strict dependency constraints

Any reason you have such strict dependency constraints?

"require": {
   "symfony/http-foundation": "~2.5.3",
    "guzzlehttp/guzzle": "~4.1.7"
}

I cannot use it with Symfony >=2.6. Since HttpFoundation's API is quite stable, i think the version could be lowered dramatically. Without tests, i 'd say to 2.1 or 2.2. At least, the constraint could be ~2.5 to allow higher versions than 2.5.

Strictly speaking, guzzlehttp/guzzle should be moved to the suggest section since you're using adapters and one could use this lib without Guzzle. I haven't tested it, but php-proxy could also possibly work with Guzzle 5.0.

I'm willing to do a PR if loosening of the constraints is desired.

Extreme delay in fread - 'connection: keep-alive' header (?)

UPDATED:

First, this probably isn't directly php-proxy, but downstream, but I'm a novice in these PHP PSR-7 parts...

Using the README boilerplate code, I was getting extremely slow responses from $proxy->to().

15 seconds, for http://example.com, several minutes for longer pages. I could see (using charles) that the remote server was returning with status=200 in milliseconds.

Via XDebug profiling (there's nothing like something that makes no sense to mandate learning new tools!) I could see that it gets tied up in fread. I've attached a screenshot, not sure if any use though.

So, anyhow, after a ton of isolating things, and progressively eliminating bits out of ::fromGlobals(), I eventually found that it seems to be the connection: keep-alive header being passed along from the client.

  • Side note from earlier: The 'accept-encoding' => 'gzip, deflate, sdch', passed through from my client still seems to have some impact, but it's inconsistent and confusing. keep-alive at least makes sense, and behaves (so far) consistently.

Using almost the stock README example (see below), but modifying the line near the top to:

$request = ServerRequestFactory::fromGlobals()->withHeader('connection', 'close');

Makes everything zippy, (if no longer gzippy [anachronistic humour fail])

<?php

require __DIR__ . '/vendor/autoload.php';

use Proxy\Proxy;
use Proxy\Adapter\Guzzle\GuzzleAdapter;
use Proxy\Filter\RemoveEncodingFilter;
use Zend\Diactoros;
use Zend\Diactoros\ServerRequestFactory;

// Create a PSR7 request based on the current browser request.
$request2 = ServerRequestFactory::fromGlobals()->withHeader('connection', 'close');

// Create a guzzle client
$guzzle = new GuzzleHttp\Client(['proxy' => 'tcp://localhost:8888']);

// Create the proxy instance
$proxy = new Proxy(new GuzzleAdapter($guzzle));

// Add a response filter that removes the encoding headers.
$proxy->filter(new RemoveEncodingFilter());

$request= $request2->withUri(new \Zend\Diactoros\Uri("http://www.manchestereveningnews.co.uk/news/local-news/st-gabriels-rc-high-school-7540058"));
//$request= $request2->withUri(new \Zend\Diactoros\Uri("http://www.example.com"));

// Forward the request
// and get the response.
$response = $proxy
    ->forward($request)
    ->to('http://www.manchestereveningnews.co.uk');


// Output response to the browser.
(new Zend\Diactoros\Response\SapiEmitter)->emit($response);

XDebug/cachegrind profile
selection_001

#17 has not been tagged.

The installation section in the README in master points to 2.*. The examples provided do not work since #17 has not been tagged.

is this support cookies?

I'm trying to use the php-proxy to forward a my site, but i can not login because the cookies is not stored anything

RequestFilter not adding into Request

When I create a custom request filter implementing the RequestFilterInterface then I am seeing some mixed results.

If I use the following filter to manipulate / add a new header, then this works fine.

<?php

namespace Proxy\Filters;

use Proxy\Request\Filter\RequestFilterInterface;
use Symfony\Component\HttpFoundation\Request;

class CustomRequestFilter implements RequestFilterInterface {

    public function filter(Request $request)
    {
        $request->headers->add(['foo' => 'bar']);
        return $request;
    }

}

However, if I do exactly the same but attempt to add content to the actual request, then the item is not added at all and is ignored.

<?php

namespace Proxy\Filters;

use Proxy\Request\Filter\RequestFilterInterface;
use Symfony\Component\HttpFoundation\Request;

class CustomRequestFilter implements RequestFilterInterface {

    public function filter(Request $request)
    {
        $request->request->add(['bar' => 'baz']);
        return $request;
    }

}

PHP Proxy is converting the script URLs

Hi,
I am using PHP proxy to get script of cross domain, But I am facing an issue. While I am calling the script of cross domain, it is also converting the link on page onto proxy page. I want the script proper but the links on scripts should be as it is. Can you please help me to sort out it.

I am giving you an example: I call a url, the whole script is coming on my end with images but some links are also converting as proxy like: src="http://optimizerpro.com/proxy/index.php?q=aHR0cDovL3NvY2lhbGJhY2tncm91bmQubmV0L3lvL2Jhbm5lci5qcGc%3D">

This is generally something else(www.ngicorporation.com) but while I used proxy it converts according to my domain.

Can you please tell me the way so that it remain same? Is there possbility ?

I will be so thankfull for your suggestion.

Yogendra Gupta
Project Manager, Mob: +919560194775,
247 Experts (P) Ltd | A-83, Okhla, New Delhi | New Delhi, India - 110019

Class ServerRequestFactory not found

Using the example in the readme I get Fatal error: Uncaught Error: Class 'Zend\Diactoros\ServerRequestFactory' not found.

This issue has been opened several times before (see #40 and #51) but none of the suggested solutions worked for me. So please update the readme...

Problems with %URL

Something wrong with %-URL?
Example (missed images) โ€” proxy: http://baz.ar.com/category/580/search/?search_with_change_category_ability=1&sorting=Price_DESC&s_period=mounth&search_price_from=&search_price_to=30000&search_date_from=&search_date_to=&is_range_315=6&param_315=0&param_322=0&is_range_18=5&is_range_317=5&is_range_319=4&param_319=0&param_to_319=0&is_range_318=4&param_318=0&param_to_318=0&is_range_321=4&param_321=0&param_to_321=0&is_range_320=4&param_320=0&param_to_320=0&param_196=&is_range_139=1&param_139=&param_to_139=&is_range_141=1&param_141=&param_to_141=&is_range_140=1&param_140=&param_to_140=&is_range_324=3&param_324=-1&is_range_179=6&param_179=0&is_range_47=6&param_47=0&is_range_60=6&param_60=0&is_range_224=6&param_224=0&is_range_323=3&param_323=0&is_range_50=6&param_50=0&is_range_328=2&param_328=0&is_range_158=6&param_158=0&is_range_325=6&param_325=0&is_range_159=6&param_159=0&is_range_160=6&param_160=0&is_range_53=6&param_53=0&is_range_44=6&param_44=0&is_range_170=6&param_170=0&is_range_163=6&param_163=0&is_range_327=2&param_327=0&is_range_59=6&param_59=0&is_range_326=2&param_326=0&is_range_165=6&param_165=0&search_in_subcategory=1&advanced_search_in_category=%D0%9D%D0%B0%D0%B9%D1%82%D0%B8&sort=Price&direction=DESC

Original: http://samuidays.ru/category/580/search/?search_with_change_category_ability=1&sorting=Price_DESC&s_period=mounth&search_price_from=&search_price_to=30000&search_date_from=&search_date_to=&is_range_315=6&param_315=0&param_322=0&is_range_18=5&is_range_317=5&is_range_319=4&param_319=0&param_to_319=0&is_range_318=4&param_318=0&param_to_318=0&is_range_321=4&param_321=0&param_to_321=0&is_range_320=4&param_320=0&param_to_320=0&param_196=&is_range_139=1&param_139=&param_to_139=&is_range_141=1&param_141=&param_to_141=&is_range_140=1&param_140=&param_to_140=&is_range_324=3&param_324=-1&is_range_179=6&param_179=0&is_range_47=6&param_47=0&is_range_60=6&param_60=0&is_range_224=6&param_224=0&is_range_323=3&param_323=0&is_range_50=6&param_50=0&is_range_328=2&param_328=0&is_range_158=6&param_158=0&is_range_325=6&param_325=0&is_range_159=6&param_159=0&is_range_160=6&param_160=0&is_range_53=6&param_53=0&is_range_44=6&param_44=0&is_range_170=6&param_170=0&is_range_163=6&param_163=0&is_range_327=2&param_327=0&is_range_59=6&param_59=0&is_range_326=2&param_326=0&is_range_165=6&param_165=0&search_in_subcategory=1&advanced_search_in_category=%D0%9D%D0%B0%D0%B9%D1%82%D0%B8&sort=Price&direction=DESC

Use as a forward proxy

Is there any way I can configure this as a forward proxy like squid. I cant use squid because it doesn't support Digest Authentication for upstream cache. Here I hope cURL can do Digest authentication for upstream proxy (?)

Does php-proxy parse an incoming CONNECT header in a TLS request?

I'm using 2.2.1 of php-proxy and have successfully set up the demo script (in the README for that version) to proxy an incoming request. I've used the built-in PHP web server for now, and that works fine.

However I'd like to support HTTPS as well, and am not sure how to go about it. I understand that a client will send a CONNECT request (see here) and I assume the body following the initial headers should be sent verbatim to the target server (presumably because it is encrypted by the client).

I was hoping that "https support" meant that this library would be able to parse incoming HTTPS, but does it just mean that it can make outgoing HTTPS requests? If so, and thus if this library is not suitable for my use case, any ideas what library I might use?

Argument exception when proxy path not available

Argument 1 passed to Zend\Diactoros\Response\SapiEmitter::emit() must implement interface Psr\Http\Message\ResponseInterface, null given

I think it must be something user friendly like "Can resolve proxy path etc." or you should throw some special exception and not Argument one.

Cannot get a simple demo working

I wanted to create a simple demo to check whether I can get this working so I have 2 blank Laravel installations side by side, I run them locally on OS X with Mamp on domains site1.dev, site2.dev.

I want to proxy requests from site1.dev to site2.dev but when I visit http://site1.dev then it keeps loading forever with no response. However, when I do simple file_get_contents('http://site2.dev') then it goes through and gets response with status code 200 and correct html in response.

I used the example code from readme:

// Create a PSR7 request based on the current browser request.
$request = ServerRequestFactory::fromGlobals();

// Create a guzzle client
$guzzle = new GuzzleHttp\Client();

// Create the proxy instance
$proxy = new Proxy(new GuzzleAdapter($guzzle));

// Add a response filter that removes the encoding headers.
$proxy->filter(new RemoveEncodingFilter());

// Forward the request and get the response.
$response = $proxy->forward($request)->to('http://site2.dev');

// Output response to the browser.
(new Zend\Diactoros\Response\SapiEmitter)->emit($response);

I'm using dev-master version here.

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.