Skip to content
Snippets Groups Projects
web.php 1.08 KiB
Newer Older
<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
Dominik Hebeler's avatar
Dominik Hebeler committed
 */

Route::get('/', function () {
Dominik Hebeler's avatar
Dominik Hebeler committed
    $password = md5(env('PROXY_PASSWORD') . $url);
    $url      = base64_encode(str_rot13($url));
    $target   = urlencode(str_replace("/", "<<SLASH>>", $url));
Dominik Hebeler's avatar
Dominik Hebeler committed
    return "<a href=\"" . action('ProxyController@proxyPage', ['password' => $password, 'url' => $target]) . "\">$url</a>";
    return md5(env('PROXY_PASSWORD') . "https://metager.de") . "<br>\n" . urlencode(base64_encode(str_rot13('https://metager.de')));
    #return redirect('https://metager.de');
});

Route::get('{password}/{url}', 'ProxyController@proxyPage')->middleware('checkpw');

Route::get('proxy/{password}/{url}', 'ProxyController@proxy')->middleware('checkpw:true');