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()); } }
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).