2022-03-14

here's my current testing grounds... it's stuck at data = br.readLine(); and i'm not sure why it doesn't stop reading just one line. i tried with read(), where it should only return a byte, and it gets stuck there too. might just modify the python reference client into having a gui.

am i missing making a request? i thought making the socket with the host was enough... this is weird territory

import java.io.*;
import java.net.*;

public class Main {
    public static void main(String[] args) throws IOException {
        URI url = null;
        try {
            url = new URI("spartan://mozz.us/");
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
        String host = url.getHost();
        int port;
        if (url.getPort() == -1)
        {
            port = 300;
        } else {
            port = url.getPort();
        }
        Socket s = new Socket(host, port);
        System.out.println(s.getInetAddress());
        String data;
        BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStream()));
        System.out.println(br.ready());
        data = br.readLine();
        //everything under here is never reached
        System.out.println(data);

        System.out.println("protocol = " + url.getScheme());
        System.out.println("host = " + url.getHost());
        System.out.println("port = " + port);
        System.out.println("path = " + url.getPath());
        System.out.println("query = " + url.getQuery());
    }
}
Proxy Information
Original URL
gemini://starjump.flounder.online/gemlog/2022-03-14.gmi
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
771.603164 milliseconds
Gemini-to-HTML Time
0.273077 milliseconds

This content has been proxied by September (ba2dc).