File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libpdel / http / test / vhost.tmpl
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:25:53 2012 UTC (12 years, 7 months ago) by misho
Branches: libpdel, MAIN
CVS tags: v0_5_3, HEAD
libpdel

<html>
<!-- $Id: vhost.tmpl,v 1.1.1.1 2012/02/21 23:25:53 misho Exp $ -->
<head>
<title>PDEL HTTP server virtual host demo</title>
</head>
<body bgcolor="#ffffff">

<h3>PDEL Virtual Hosting</h3>

<p>
This servlet is registered to handle the ``default'' virtual host,
i.e., requests that don't match the virtual host specified on the
command line, which is <b>@htmlencode(@vhost())</b>.

<p>
@if(@equal(@get_header("Host"), ""))
	Your browser sent no Host: header. It must be really old.
@else
	Your browser sent this Host: header:

	<blockquote>
	<b>Host: @htmlencode(@get_header("Host"))</b>
	</blockquote>

@endif

@set("scheme", "http")
@if(@get_ssl())
	@set("ssl", "s")
@endif()
@if(@or(
    @and(@not(@get_ssl()), @not(@equal(@get_port(), "80"))),
    @and(@get_ssl(), @not(@equal(@get_port(), "443")))))
	@set("port", @cat(":", @get_port()))
@endif()

@set("url", @cat(@get("scheme"), "://", @vhost(), @get("port"), "/"))

<p>
To get to the virtual host <b>@htmlencode(@vhost())</b>, click on this link:

<blockquote>
<b><a href="@get("url")">@htmlencode(@get("url"))</a></b>
</blockquote>

</body>
</html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>