107 lines
2.8 KiB
Bash
107 lines
2.8 KiB
Bash
#!/bin/bash
|
|
# Setup script for FuckHTTP3 web proxy
|
|
|
|
# Create templates directory if it doesn't exist
|
|
mkdir -p templates
|
|
|
|
# Check if index.html exists in templates directory
|
|
if [ ! -f templates/index.html ]; then
|
|
echo "Creating templates/index.html"
|
|
cat > templates/index.html << 'EOL'
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>FuckHTTP3 Proxy</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
min-height: 100vh;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.container {
|
|
background-color: white;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
padding: 30px;
|
|
width: 80%;
|
|
max-width: 600px;
|
|
text-align: center;
|
|
}
|
|
h1 {
|
|
color: #333;
|
|
margin-bottom: 20px;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
input[type="text"] {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border: 1px solid #ddd;
|
|
border-radius: 4px;
|
|
font-size: 16px;
|
|
box-sizing: border-box;
|
|
}
|
|
button {
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
font-size: 16px;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
transition: background-color 0.3s;
|
|
}
|
|
button:hover {
|
|
background-color: #45a049;
|
|
}
|
|
.error {
|
|
color: #f44336;
|
|
margin-top: 20px;
|
|
}
|
|
footer {
|
|
margin-top: 20px;
|
|
color: #666;
|
|
font-size: 14px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>FuckHTTP3 Web Proxy</h1>
|
|
<p>Enter a URL below to browse through the HTTP/3 proxy</p>
|
|
|
|
{{if .Error}}
|
|
<div class="error">{{.Error}}</div>
|
|
{{end}}
|
|
|
|
<form action="/proxy" method="post">
|
|
<div class="form-group">
|
|
<input type="text" name="url" placeholder="https://example.com"
|
|
value="{{.URL}}" required autofocus>
|
|
</div>
|
|
<button type="submit">Browse</button>
|
|
</form>
|
|
|
|
<footer>
|
|
Powered by FuckHTTP3 Proxy - Using HTTP/3 with QUIC
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
EOL
|
|
fi
|
|
|
|
echo "Template setup complete!"
|
|
chmod +x setup-templates.sh |