I've made a socket which will accept any get/post requests on a port.
And for now based on the uri it prints out different strings to the repl.
/
will just say "hello"
/whatever
says "hello, whatever"
But now I need to send a response to the browser, this is what I have, but I'm not getting a response in the browser:
(def output (.getOutputStream accepted-socket))
(map (fn[char] (.write @output (int char)))
"HTTP/1.1 200 OK\nContent-Type: text/html\nContent-Length: 44\nConnection: close\r\n\r\n
<html><body><h1 Please work!/></body></html>")
user=> (import 'java.net.Socket)
java.net.Socket
user=> (def s (Socket. "localhost" 7777))
#'user/s
user=> (with-open [o (io/writer s)]
(.write o "hello, world"))
nil