From 3b04fd45c7695ae007d6aed4dfda1f0063a32952 Mon Sep 17 00:00:00 2001 From: IonutParau Date: Sat, 23 May 2026 20:30:31 +0200 Subject: [PATCH] internet progress --- src/neonucleus.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/neonucleus.h b/src/neonucleus.h index a435fed..013436c 100644 --- a/src/neonucleus.h +++ b/src/neonucleus.h @@ -2360,6 +2360,39 @@ typedef struct nn_InternetCard { extern nn_InternetCard nn_defaultInternetCard; +typedef struct nn_InternetConnection { + nn_InternetProtocol protocol; + void *state; +} nn_InternetConnection; + +typedef struct nn_HTTPHeader { + const char *name; + const char *value; +} nn_HTTPHeader; + +typedef struct nn_InternetRequest { + nn_Context *ctx; + nn_Computer *computer; + void *state; + const nn_Tunnel *tunnel; + const char *localAddress; + nn_InternetConnection *connection; + union { + // does a socket connection, for any of the supported protocols + struct { + // URL of connection + const char *url; + // port. Useless for HTTP connections, as they should use 80 for HTTP and 443 for HTTPS + unsigned short port; + // HTTP specific + size_t postdatalen; + const char *postdata; + const nn_HTTPHeader *headers; + size_t headerlen; + } connect; + }; +} nn_InternetRequest; + // Colors and palettes. // Do note that the