src/Runscope/Plugin/RunscopePlugin.php
public function onBeforeSend(Event $event)
    {
        /** @var \Guzzle\Http\Message\Request $request */
        $request = $event['request'];

        list($newUrl, $port) = $this->proxify(
            $request->getUrl(),
            $this->bucketKey,
            $this->gatewayHost
        );

        $request->setUrl($newUrl);

        if ($port) {
            $request->setHeader('Runscope-Request-Port', $port);
        }

        if ($this->authToken) {
            $request->setHeader('Runscope-Bucket-Auth', $this->authToken);
        }
    }
public function onBeforeSend(Event $event)
    {
        /** @var \Guzzle\Http\Message\Request $request */
        $request = $event['request'];

        list($newUrl, $port) = $this->proxify(
            $request->getUrl(),
            $this->bucketKey,
            $this->gatewayHost
        );

        $request->setUrl($newUrl);

        if ($port) {
            $request->setHeader('Runscope-Request-Port', $port);
        }

        if ($this->authToken) {
            $request->setHeader('Runscope-Bucket-Auth', $this->authToken);
        }
    }
public function onBeforeSend ( Event $ event ) { /** @var \Guzzle\Http\Message\Request $request */ $ request = $ event [ 'request' ] ; list ( $ newUrl , $ port ) = $ this -> proxify ( $ request -> getUrl ( ) , $ this -> bucketKey , $ this -> gatewayHost ) ; $ request -> setUrl ( $ newUrl ) ; if ( $ port ) { $ request -> setHeader ( 'Runscope-Request-Port' , $ port ) ; } if ( $ this -> authToken ) { $ request -> setHeader ( 'Runscope-Bucket-Auth' , $ this -> authToken ) ; } }
Event triggered right before sending a request

@param Event $event
Event triggered right before sending a request