This topic HAS now cycled around until it IS the same now as
viewtopic.php?f=11&t=2914
In that post I said "I can't send HTTP requests from one prim to another", Oren's answer: that is disabled in OpenSim for security reasons.
(It works in SL and in IW, it works if script A is in Kitely and script B is in SL or visa versa)
So I tried moving all the HTTP requests to my WEB hosting server, they say "sending HTTP requests to an address with a port number is disabled for security reasons". I'm setting up another server.
In the mean time, Oren says:
* Script B can now use llHttpRequest() to call Script A.
NO! that is the gist of my other thread that Oren said is disabled for security reasons!
To demonstrate this, create two prims, PrimA and PrimB. Put the following script in Prim B. It will dump a URL out to local chat. Cut out that URL and try it in the address line of your browser, you will see Hello World! Then paste the URL into the url string in Script A below. Put Script A in Prim A and click on it. Each click tries to do an HTTP request to the Prim B URL, but gets the following error message:
llHttpRequest: Request to <script b URL> disallowed by filter.
The URLs that llRequestURL returns do not look like requests to the local server, I assume the routers at Amazon notice that they loop back to a local server and optimize them for you, and then OpenSim refuses to accept them. Is there a way to fix the test in OpenSim so it refuses all requests to the local network EXCEPT the ones from prim to prim? Then we would have a way to communicate between prims again.
Code: Select all
//Script B
//put this script in Prim B
//generates a URL and displays it in local chat
//cut that out of local chat and paste it into the url string of Script A
//Or paste it into the address line of your brouser to see what is supposed to happen
//when an HTTP request is sent to that address, you should see messages from this prim
//and messages at the requesting end.
string urlB="";
key urlRequestID;
default
{
state_entry()
{
llSay(0, "free URLs "+(string)llGetFreeURLs());
urlRequestID = llRequestURL(); //ask for a URL
}
http_request(key id, string method, string body)
{
integer responseStatus = 400;
string responseBody = "Unsupported method";
if (method == URL_REQUEST_DENIED)
llOwnerSay("The following error occurred while attempting to get a free URL for this device:\n" + body);
else if (method == URL_REQUEST_GRANTED)
{
urlB = body;
llOwnerSay("url is "+urlB);
return;
}
else if (method == "GET")
{
string args=llGetHTTPHeader(id,"x-query-string" );
llOwnerSay("I got a GET\nargs="+args+"\nbody="+body);
responseStatus = 200;
responseBody = "Hello world!";
}
else if (method == "POST")
{
llOwnerSay("I got a POST\nbody="+body);
responseStatus = 200;
responseBody = "POST world!";
}
else if (method == "PUT")
llOwnerSay("I got a PUT");
llHTTPResponse(id, responseStatus, responseBody);
}
}
Code: Select all
//Script A
//HTTPRequest test
//Put this script in prim A
//paste the URL from Script B into the following string:
//(don't use the address I left there, it has probably expired)
//then touch the prim
string url=" http://ec2-54-193-199-92.us-west-1.compute.amazonaws.com:9001/lslhttp/d3e857ce-d481-455d-9465-1ce1730bca15/";
default
{
touch_start(integer num)
{
llHTTPRequest(url,[],""); //make the request
} //touch_start
//display the response, easy as 3.14159
http_response(key request_id, integer status, list metadata, string body)
{
llOwnerSay("HTTP Responce status="+(string)status+"\n"+body);
}
}