first commit

This commit is contained in:
Finn
2026-01-16 23:45:06 +01:00
commit 20df71f96d
37 changed files with 3244 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package org.openautonomousconnection.oac2web;
import org.openautonomousconnection.protocol.packets.v1_0_0.beta.WebResponsePacket;
import org.openautonomousconnection.webserver.api.WebPage;
import org.openautonomousconnection.webserver.api.WebPageContext;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Scanner;
public class ins implements WebPage {
@Override
public WebResponsePacket handle(WebPageContext webPageContext) throws Exception {
String content = null;
URLConnection connection = null;
try {
connection = new URL("https://open-autonomous-connection.org/ins.php").openConnection();
Scanner scanner = new Scanner(connection.getInputStream());
scanner.useDelimiter("\\Z");
content = scanner.next();
scanner.close();
}catch ( Exception ex ) {
content = ex.getMessage();
ex.printStackTrace();
}
return new WebResponsePacket(308, "text/html", new HashMap<>(), content.getBytes(StandardCharsets.UTF_8));
}
}