* @param string $method the http protocol variant: defaults to 'http'; 'https', 'http11', 'http2' and 'http2tls' can
* be used if CURL is installed. The value set here can be overridden in any call to $this->send().
* Use 'http2' to make the lib attempt to use http/2 without tls and 'http2tls' for secure http/2
+ * (note that 'http2' will most likely not result in an http/2 connection in any case, as it
+ * seems that upgrading a POST request on the fly from http is hard or impossible)
*/
public function __construct($path, $server = '', $port = '', $method = '')
{
* @param string $method valid values are 'http', 'http11', 'https', 'http2' and 'http2tls'. If left unspecified,
* the http protocol chosen during creation of the object will be used.
* Use 'http2' to make the lib attempt to use http/2 without tls and 'http2tls' for secure http/2
+ * (note that 'http2' will most likely not result in an http/2 connection in any case, as it
+ * seems that upgrading a POST request on the fly from http is hard or impossible)
*
* @return Response|Response[] Note that the client will always return a Response object, even if the call fails
* @todo allow throwing exceptions instead of returning responses in case of failed calls and/or Fault responses
$this->client->method = 'http2';
//$this->client->keepalive = false; // q: is this a good idea?
- $this->expectHttp2 = true;
+ /// @todo we disable checking for HTTP2 on plain http calls, as that is unsupported for POST requests
+ //$this->expectHttp2 = true;
$this->$method();
- $this->expectHttp2 = false;
+ //$this->expectHttp2 = false;
}
/**
*/
protected function validateResponse($r)
{
- /// @todo check $r->httpResponse()['protocol_version']
if ($this->expectHttp2) {
-
+ $hr = $r->httpResponse();
+ $this->assertEquals("2", $hr['protocol_version']);
} else {
}
# HTTPSERVER
# TESTS_ROOT_DIR
+<IfModule http2_module>
+ LogLevel http2:info
+</IfModule>
+
<VirtualHost *:80>
- # Enable http2
- Protocols h2c http/1.1
+ <IfModule http2_module>
+ # Enable http2
+ Protocols h2c http/1.1
+ </IfModule>
DocumentRoot ${TESTS_ROOT_DIR}
<VirtualHost _default_:443>
- # Enable http2
- Protocols h2 http/1.1
+ <IfModule http2_module>
+ # Enable http2
+ Protocols h2 http/1.1
+ </IfModule>
DocumentRoot ${TESTS_ROOT_DIR}
echo "[$(date)] Starting Privoxy..."
service privoxy start
+echo "[$(date)] Bootstrap finished"
+
tail -f /dev/null &
child=$!
wait "$child"
# Install and configure apache2
# Has to be run as admin
-# @todo make this work across all ubuntu versions (precise to focal)
+# @todo make this work across all ubuntu versions (precise to jammy)
set -e
service php-fpm start
-# configure apache (if installed)
+# reconfigure apache (if installed). Sadly, php will switch on mod-php and mpm_prefork at install time...
if [ -n "$(dpkg --list | grep apache)" ]; then
+ # @todo silence errors in a smarter way
+ rm /etc/apache2/mods-enabled/php* || true
+ a2dismod mpm_prefork
+ a2enmod mpm_event
a2enconf php${PHPVER}-fpm
service apache2 restart
fi