Jump to content

Infinity Shoreman

Resident
  • Posts

    6
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Fixed! Here's the solution! http://stackoverflow.com/questions/38698902/adding-content-type-headers-to-java-http-echo-server
  2. oooh this looks like it! Someone suggested it seeds a content type header but I've been struggling to make that work. I'll keep at it since that seems to be the issue!
  3. Nice catch but that's just a placeholder to keep my server IP private. I get status 200. I think the LSL is fine, pretty sure it's an issue with how the response is being formatted. There's something about the returning data that SL doesn't like.
  4. hi! I'm working on making a script that uses an httpserver. I've tested my lsl code and it works with public test echo servers. I've tested my own echo server and it works with public httprequest post testers. It gets the data and sends it back fine. If I send data from SL to my own server it gets it and sends it back, but only the status comes through. The body field gets nothing. Am I messing up some data formatting or something? It seems like SL is getting it and choosing not to relay it. Any tips appreciated. (my httpserver is in java btw..) key requestid; // just to check if we're getting the result we've asked for; all scripts in the same object get the same replies default { touch_start(integer number) { requestid = llHTTPRequest("AnyEchoServer", [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"], "parameter1="+(string)llDetectedKey(0)); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == requestid){ llOwnerSay("Web server said: " + body); } } }/* * EchoServer.java * * Accept an HTTP request and echo it back as the HTTP response. * * Copyright (c) 2005 Sun Microsystems, Inc * Copyright (c) 2008 Operational Dynamics Consulting, Pty Ltd * * The code in this file is made available to you by its authors under the * terms of the "GNU General Public Licence, version 2" See the LICENCE file * for the terms governing usage and redistribution. */ /* * This code is a simple derivation of the example in the package * documentation for com.sun.net.httpserver, as found in file * jdk/src/share/classes/com/sun/net/httpserver/package-info.java as shipped * with the openjdk 1.6 b08 code drop. Used under the terms of the GPLv2. */ import static java.net.HttpURLConnection.HTTP_OK; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.URLDecoder; import java.util.List; import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; import com.sun.net.httpserver.HttpServer; /** * Echo the body of an HTTP request back as the HTTP response. This is merely * a simple exercise of the Secret Sun Web Server. As configured, the URL to * access it is http://localhost:8000/echo. * * @author Andrew Cowie */ public final class Test { public static void main(String[] args) throws IOException { final InetSocketAddress addr; final HttpServer server; addr = new InetSocketAddress(8000); server = HttpServer.create(addr, 10); server.createContext("/echo", new EchoHandler()); server.start(); } } class EchoHandler implements HttpHandler { public void handle(HttpExchange t) throws IOException { final InputStream is; final OutputStream os; StringBuilder buf; int b; final String request, response; buf = new StringBuilder(); /* * Get the request body and decode it. Regardless of what you are * actually doing, it is apparently considered correct form to consume * all the bytes from the InputStream. If you don't, closing the * OutputStream will cause that to occur */ is = t.getRequestBody(); while ((b = is.read()) != -1) { buf.append((char) b); } is.close(); if (buf.length() > 0) { request = URLDecoder.decode(buf.toString(), "UTF-8"); } else { request = null; } /* * Construct our response: */ buf = new StringBuilder(); buf.append("<html><head><title>HTTP echo server</title></head><body>"); buf.append("<p><pre>"); buf.append(t.getRequestMethod() + " " + t.getRequestURI() + " " + t.getProtocol() + "\n"); /* * Process the request headers. This is a bit involved due to the * complexity arising from the fact that headers can be repeated. */ Headers headers = t.getRequestHeaders(); for (String name : headers.keySet()) { List<String> values = headers.get(name); for (String value : values) { buf.append(name + ": " + value + "\n"); } } /* * If there was an actual body to the request, add it: */ if (request != null) { buf.append("\n"); buf.append(request); } buf.append("</pre></p>"); buf.append("</body></html>\n"); response = buf.toString(); System.out.println(response); /* * And now send the response. We could have instead done this * dynamically, using 0 as the response size (forcing chunked * encoding) and writing the bytes of the response directly to the * OutputStream, but building the String first allows us to know the * exact length so we can send a response with a known size. Better :) */ t.sendResponseHeaders(HTTP_OK, response.length()); os = t.getResponseBody(); os.write(response.getBytes()); /* * And we're done! */ os.close(); t.close(); } }s
  5. Is it impossible with that GPU? http://www.game-debate.com/games/index.php?g_id=718&canMyGpuRunIt=Second%20Life
  6. Hey all, So for fun I've been trying to get SL working on an amazon remote desktop (https://aws.amazon.com/marketplace/pp/B00FGB1VTC#product-details). Bit unorthodox way to play but I'd really like to get it working. The servers are running the following: GPU: NVidia grid k250 Windows: Windows Server 2008 R2 Datacenter I get the "video card drivers did not install properly, are out of date. or are for unsupported hardware" bit. I've already run through all the troubleshooting options. (Which is pretty much 100% "just do a clean reinstall for the drivers!") Any ideas would be greatly appreciated!
×
×
  • Create New...