
char buf[4096];
snprintf(buf, sizeof(buf), "GET / HTTP/1.0\r\nHost: %s\r\n\r\n", host);
PRInt32 ret = PR_Write(nspr, buf, strlen(buf));
if (ret < 0) {
  const PRErrorCode err = PR_GetError();
  fprintf(stderr, "error: PR_Write error %d: %s\n",
	    err, PR_ErrorToName(err));
  exit(1);
}
ret = PR_Read(nspr, buf, sizeof(buf));
if (ret < 0) {
  const PRErrorCode err = PR_GetError();
  fprintf(stderr, "error: PR_Read error %d: %s\n",
	    err, PR_ErrorToName(err));
  exit(1);
}

