view mod_tcpproxy/web/demo.html @ 4270:243f7b0dbf35

mod_http_oauth2: Reduce authorization code validity time to 2 minutes RFC 6749 states > A maximum authorization code lifetime of 10 minutes is RECOMMENDED. So 15 minutes was way too long. I was thinking 5 minutes at first but since this should generally be instant, I settled on 2 minutes as a large guesstimate on how slow it might be on slow links.
author Kim Alvefur <zash@zash.se>
date Sun, 22 Nov 2020 18:46:25 +0100
parents 7dbde05b48a9
children
line wrap: on
line source

<html>
<head>
	<script type="text/javascript" src="xmpp.io.js"></script>
	<script type="text/javascript" src="strophe.js"></script>
	<script type="text/javascript" src="src/jquery-1.4.2.min.js"></script>
	<script type="text/javascript">
		function handle_connection_status(status, err)
		{
			console.log("XMPP status: "+Strophe.Status.CONNECTED);
			if(status == Strophe.Status.CONNECTED)
			{
				var conn = new XMPPIO(xmppconn, "tcp.localhost");
				conn.addListener("connect", function () {
					var req = "GET / HTTP/1.0\r\nHost: example.com\r\n\r\n";
					console.log("Sending request: "+req);
					conn.write(req);
				});
				conn.addListener("data", function (data)
				{
					$("<div/>").text(data).appendTo("body");
				});
				console.log("Connecting to example.com:80...");
				conn.connect("example.com", 80);
			}
		}

		var xmppconn = new Strophe.Connection("/http-bind");
		xmppconn.connect("anon.localhost", null, handle_connection_status, 50);

	</script>
</head>
<body>
</body>
</html>