diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 94a25f7..35eb1dd 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index dad740a..1f2d335 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.openautonomousconnection
WebClient
- 1.0-BETA.1.0
+ 1.0.0-BETA.1.1
Open Autonomous Connection
https://open-autonomous-connection.org/
@@ -45,48 +45,14 @@
Issue Tracker
- https://repo.open-autonomous-connection.org/open-autonomous-connection/WebClient/issues
+ https://repo.open-autonomous-connection.org/open-autonomous-connection/DNSServer/issues
- Open Autonomous Public License (OAPL)
- https://open-autonomous-connection.org/license.html
-
-
- GNU General Public License v3.0
- https://www.gnu.org/licenses/gpl-3.0.html
-
- Default license: Applies to all users and projects unless an explicit alternative license has been granted.
-
-
-
- LPGL 3
- https://www.gnu.org/licenses/lgpl-3.0.html#license-text
-
-
- LPGL 2.1
- https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.en#SEC1
-
-
- WTPL License
- https://github.com/ronmamo/reflections/tree/master?tab=WTFPL-1-ov-file
-
-
- Apache License 2.0
- https://www.apache.org/licenses/LICENSE-2.0.txt
-
-
- MIT License
- https://opensource.org/license/mit
-
-
- javassist
- https://github.com/jboss-javassist/javassist/blob/master/License.html
-
-
- projectlombok
- https://github.com/projectlombok/lombok?tab=License-1-ov-file
+ Open Autonomous Public License
+ https://repo.open-autonomous-connection.org/Open-Autonomous-Connection/OAPL/
+ repo
@@ -104,7 +70,7 @@
org.openautonomousconnection
protocol
- 1.0.0-BETA.5
+ 1.0.0-BETA.5.2
org.projectlombok
@@ -112,30 +78,21 @@
1.18.38
provided
+
+ org.jsoup
+ jsoup
+ 1.22.1
+ compile
+
+
+ org.openautonomousconnection
+ luascript
+ 1.0-BETA.1.0
+
+
+ org.openautonomousconnection.infonamelib
+ InfoNameLib
+ 1.0.0-BETA.1.0
+
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.6.0
-
-
- package
-
- shade
-
-
-
-
- org.openautonomousconnection.webclient.Main
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/main/java/org/openautonomousconnection/webclient/Main.java b/src/main/java/org/openautonomousconnection/webclient/Main.java
new file mode 100644
index 0000000..8a3f94f
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/Main.java
@@ -0,0 +1,80 @@
+/* Author: Maple
+ * Dec. 12 2025
+ * */
+
+package org.openautonomousconnection.webclient;
+
+import dev.unlegitdqrk.unlegitlibrary.event.EventManager;
+import dev.unlegitdqrk.unlegitlibrary.network.system.packets.PacketHandler;
+import org.openautonomousconnection.protocol.ProtocolBridge;
+import org.openautonomousconnection.protocol.ProtocolSettings;
+import org.openautonomousconnection.protocol.versions.ProtocolVersion;
+import org.openautonomousconnection.webclient.network.WebClient;
+import org.openautonomousconnection.webclient.network.handlers.ServerPacketHandler;
+import org.openautonomousconnection.webclient.packetlistener.listeners.WebPacketListener;
+import org.openautonomousconnection.webclient.ui.MainFrame;
+
+import java.beans.EventHandler;
+import java.io.File;
+
+public class Main {
+ public static MainFrame mainFrame;
+
+ public static final String DEFAULT_HOST = "ins.open-autonomous-connection.org";
+
+ public static final int DEFAULT_PORT = 1023;
+
+ private static final ProtocolVersion PROTOCOL_VERSION = ProtocolVersion.PV_1_0_0_BETA;
+
+ public static WebClient client;
+
+ public static ProtocolBridge bridge;
+
+ public static void main(String[] args) {
+ initProtocol();
+
+ try {
+ registerEventHandlers();
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ registerPacketListeners();
+
+ mainFrame = new MainFrame();
+
+ mainFrame.setVisible(true);
+ }
+
+ private static void initProtocol() {
+ client = new WebClient();
+
+ ProtocolSettings settings = new ProtocolSettings();
+
+ settings.packetHandler = new PacketHandler();
+ settings.eventManager = new EventManager();
+
+ settings.host = DEFAULT_HOST;
+ settings.port = DEFAULT_PORT;
+
+ try {
+ bridge = new ProtocolBridge(
+ client,
+ settings,
+ PROTOCOL_VERSION,
+ new File("logs")
+ );
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private static void registerEventHandlers() throws Exception {
+ EventManager eventManager = bridge.getProtocolSettings().eventManager;
+
+ eventManager.registerListener(ServerPacketHandler.class);
+ }
+
+ private static void registerPacketListeners() {
+ ServerPacketHandler.registerPacketListener(new WebPacketListener());
+ }
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/Promise.java b/src/main/java/org/openautonomousconnection/webclient/network/Promise.java
new file mode 100644
index 0000000..c09b387
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/Promise.java
@@ -0,0 +1,59 @@
+package org.openautonomousconnection.webclient.network;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.concurrent.*;
+
+/**
+ * An object that is still waited for to be delivered by the server
+ *
+ * @param type of promised object
+ */
+public class Promise {
+ @Getter @Setter
+ private T object;
+
+ public Promise() {
+ }
+
+ public Promise(T object) {
+ this.object = object;
+ }
+
+ public static Promise yieldPromise(int timeout, T reference) {
+ try (ExecutorService executorService = Executors.newSingleThreadExecutor()) {
+ Callable task = () -> {
+ for(int i = 0; i < timeout; i++) {
+ if(reference == null) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ if(reference == null)
+ throw new TimeoutException();
+
+ return reference;
+ };
+
+ Future future = executorService.submit(task);
+
+ executorService.shutdown();
+
+ try {
+ return new Promise<>(future.get());
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ }
+
+ private Class> getType() {
+ return this.object.getClass();
+ }
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/WebClient.java b/src/main/java/org/openautonomousconnection/webclient/network/WebClient.java
new file mode 100644
index 0000000..4ad230c
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/WebClient.java
@@ -0,0 +1,107 @@
+/* Author: Maple
+ * Dec. 12 2025
+ * */
+
+package org.openautonomousconnection.webclient.network;
+
+import lombok.Getter;
+import org.openautonomousconnection.protocol.packets.v1_0_0.beta.WebRequestPacket;
+import org.openautonomousconnection.protocol.side.client.ProtocolClient;
+import org.openautonomousconnection.protocol.versions.v1_0_0.beta.INSRecord;
+import org.openautonomousconnection.protocol.versions.v1_0_0.beta.INSResponseStatus;
+import org.openautonomousconnection.protocol.versions.v1_0_0.beta.WebRequestMethod;
+import org.openautonomousconnection.webclient.network.type.NTFType;
+import org.openautonomousconnection.webclient.network.type.text.NetTransmitDocument;
+import org.openautonomousconnection.webclient.network.type.NetTransmitFile;
+
+import javax.swing.text.Document;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Uses the OAC-Protocol networking client
+ * Suppressing "unchecked" warnings because of generic casts
+ */
+@SuppressWarnings("unchecked")
+public class WebClient extends ProtocolClient {
+ /**
+ * Global protocol timeout = 30 seconds
+ */
+ public static final int TIMEOUT = 30;
+
+ public void fulfillPromise(NTFType type, T object) {
+ if(!this.outstandingPromises.containsKey(type))
+ return;
+
+ Object promisedValue = this.outstandingPromises.get(type);
+
+ if(promisedValue != null)
+ return;
+
+ this.outstandingPromises.replace(type, object);
+ }
+
+ @Getter
+ private final Map outstandingPromises = new HashMap<>();
+
+ private Promise extends NetTransmitFile> promise(NTFType type) {
+ NetTransmitFile ntf = NetTransmitFile.of(type, null);
+
+ this.outstandingPromises.put(type, ntf);
+
+ return Promise.yieldPromise(TIMEOUT, ntf);
+ }
+
+ @Override
+ public void onResponse(INSResponseStatus insResponseStatus, List list) {
+ }
+
+ public Promise extends NetTransmitFile> get(NTFType type, String path, T test) {
+ try {
+ this.getClientWebConnection().sendPacket(new WebRequestPacket(
+ path,
+ WebRequestMethod.GET,
+ Map.of(),
+ null
+ ));
+
+ } catch (IOException | ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+
+ return this.promise(type);
+ }
+
+ public void post(String path) {
+ try {
+ this.getClientWebConnection().sendPacket(new WebRequestPacket(
+ path,
+ WebRequestMethod.POST,
+ Map.of(),
+ null
+ ));
+ } catch (IOException | ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Promise> getIndex() {
+ try {
+ this.getClientWebConnection().sendPacket(new WebRequestPacket(
+ "index.html",
+ WebRequestMethod.GET,
+ Map.of(),
+ null
+ ));
+ } catch (IOException | ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+
+ System.out.println(promise(NTFType.DOCUMENT).getClass().getSimpleName());
+
+ return null;//(Promise>) promise(NTFType.DOCUMENT);
+ }
+
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/handlers/ClassicHandler.java b/src/main/java/org/openautonomousconnection/webclient/network/handlers/ClassicHandler.java
new file mode 100644
index 0000000..c5e0796
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/handlers/ClassicHandler.java
@@ -0,0 +1,43 @@
+/* Author: Maple
+ * Dec. 12 2025
+ * */
+
+package org.openautonomousconnection.webclient.network.handlers;
+
+import org.openautonomousconnection.protocol.side.client.ProtocolClient;
+import org.openautonomousconnection.protocol.versions.v1_0_0.beta.INSResponseStatus;
+import org.openautonomousconnection.protocol.versions.v1_0_0.classic.handlers.ClassicHandlerClient;
+import org.openautonomousconnection.protocol.versions.v1_0_0.classic.objects.Classic_Domain;
+import org.openautonomousconnection.protocol.versions.v1_0_0.classic.site.Classic_SiteType;
+import org.openautonomousconnection.protocol.versions.v1_0_0.classic.utils.Classic_ProtocolVersion;
+
+/**
+ * Handle deprecated (classic) versions
+ */
+
+@SuppressWarnings("deprecated")
+public class ClassicHandler extends ClassicHandlerClient {
+ public ClassicHandler(ProtocolClient client) {
+ super(client);
+ }
+
+ @Override
+ public void unsupportedClassicPacket(String className, Object[] objects) {
+
+ }
+
+ @Override
+ public void handleHTMLContent(Classic_SiteType classicSiteType, Classic_Domain classicDomain, String s) {
+
+ }
+
+ @Override
+ public void handleMessage(String message, Classic_ProtocolVersion classicProtocolVersion) {
+
+ }
+
+ @Override
+ public void validationCompleted(Classic_Domain classicDomain, INSResponseStatus insResponseStatus) {
+
+ }
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/handlers/ServerPacketHandler.java b/src/main/java/org/openautonomousconnection/webclient/network/handlers/ServerPacketHandler.java
new file mode 100644
index 0000000..6c38526
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/handlers/ServerPacketHandler.java
@@ -0,0 +1,35 @@
+/* Author: Maple
+ * Jan. 16 2026
+ * */
+
+package org.openautonomousconnection.webclient.network.handlers;
+
+import dev.unlegitdqrk.unlegitlibrary.event.EventListener;
+import dev.unlegitdqrk.unlegitlibrary.network.system.client.events.C_PacketReceivedEvent;
+import dev.unlegitdqrk.unlegitlibrary.network.system.packets.Packet;
+import org.openautonomousconnection.protocol.packets.v1_0_0.beta.AuthPacket;
+import org.openautonomousconnection.protocol.packets.v1_0_0.beta.WebResponsePacket;
+import org.openautonomousconnection.webclient.packetlistener.PacketListener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ServerPacketHandler extends EventListener {
+
+ private static final List listeners = new ArrayList<>();
+
+ public static void registerPacketListener(PacketListener packetListener) {
+ listeners.add(packetListener);
+ }
+
+ public void onPacketReceived(C_PacketReceivedEvent packetReceivedEvent) {
+
+ Packet packet = packetReceivedEvent.getPacket();
+
+ switch (packet.getPacketID()) {
+ case 4 -> listeners
+ .forEach(l -> l.onAuthPacketReceived((AuthPacket) packet));
+ case 9 -> listeners
+ .forEach(l -> l.onWebResponsePacketReceived((WebResponsePacket) packet));}
+ }
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/type/NTFType.java b/src/main/java/org/openautonomousconnection/webclient/network/type/NTFType.java
new file mode 100644
index 0000000..78e0555
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/type/NTFType.java
@@ -0,0 +1,13 @@
+/* Author: Maple
+ * Jan. 17 2026
+ * */
+
+package org.openautonomousconnection.webclient.network.type;
+
+public enum NTFType {
+ UNKNOWN,
+ STYLESHEET,
+ DOCUMENT,
+ ICON,
+ FILE
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitFile.java b/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitFile.java
new file mode 100644
index 0000000..28c55da
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitFile.java
@@ -0,0 +1,34 @@
+/* Author: Maple
+ * Jan. 17 2026
+ * */
+
+package org.openautonomousconnection.webclient.network.type;
+
+import org.jsoup.nodes.Document;
+import org.openautonomousconnection.webclient.network.type.application.NetAppstreamFile;
+import org.openautonomousconnection.webclient.network.type.image.NetTransmitIcon;
+import org.openautonomousconnection.webclient.network.type.text.NetTransmitDocument;
+import org.openautonomousconnection.webclient.network.type.text.NetTransmitStylesheet;
+import org.w3c.dom.css.CSSStyleSheet;
+
+import javax.swing.*;
+import java.io.File;
+
+public interface NetTransmitFile {
+ T getNtf();
+ void setNtf(T ntf);
+
+ @SuppressWarnings("unchecked")
+ static NetTransmitFile of(NTFType type, T ntf) {
+ return (NetTransmitFile) switch (type) {
+ case FILE -> new NetAppstreamFile((File) ntf);
+
+ case ICON -> new NetTransmitIcon((ImageIcon) ntf);
+
+ case DOCUMENT -> new NetTransmitDocument((Document) ntf);
+ case STYLESHEET -> new NetTransmitStylesheet((CSSStyleSheet) ntf);
+
+ case null, default -> new NetTransmitUnknown(ntf);
+ };
+ }
+}
diff --git a/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitUnknown.java b/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitUnknown.java
new file mode 100644
index 0000000..e4f269a
--- /dev/null
+++ b/src/main/java/org/openautonomousconnection/webclient/network/type/NetTransmitUnknown.java
@@ -0,0 +1,20 @@
+/* Author: Maple
+ * Jan. 17 2026
+ * */
+
+package org.openautonomousconnection.webclient.network.type;
+
+import lombok.Getter;
+import lombok.Setter;
+
+public class NetTransmitUnknown implements NetTransmitFile