So i'm trying to make a webpage, that launches local applications through a client.
The simplist solution I can think of is just posting or getting data to the port I want to use; say port 3000. Unfortuantely I've run into an error: XMLHttpRequest cannot load %3127.0.0.1:3000. Cross origin requests are only supported for HTTP.
My Question: Is there a way to post or get data to 127.0.0.1:3000 using XMLHttpRequest()?
sorry about the formatting mess, I played around with it for a long time and I couldn't get it to indent correctly D:
function Post_Command(Command_String){ if(typeof(Command_String) != "string"){ console.log( "Invalid Call:\Post_Command(\n\t"+Command_String+":"+typeof(Command_String)+"\n)" ); } else { xmlhttp=new XMLHttpRequest(); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ console.log(xmlhttp.responseText); } } xmlhttp.open( "POST", "127.0.0.1:3000", true ); xmlhttp.send(Command_String); } }