Execute command from browser

Hi there, sorry for cross posting. I hope simplifying my question will make me easier to help.

I’m using 6.2.2 Professional studio (trial) [I’m making something for a mairlist user]

from my browser typing
username:password@127.0.0.1:9300/status/onair

will return the onair status. So I’m connected.

What should I type to execute a command, I thought it would be something like this, but I’m wrong.
username:password@127.0.0.1:9300/execute/ALL%20PLAYERS%20START

Hey!
How come using the 6.2.2 Professional Studio when the current release is 7.2?
Anyways, the execute command requires HTTP POST, and not GET.

HTTP POST: username:password@127.0.0.1:9300/execute?command=AUTOMATION 1 START

See the wiki: config:remotecontrol:rest [mAirList Wiki]
Remember to grant your REST user permission to execute commands!

Thomas

Newer versions also accept GET for /execute requests.

I’m not commenting on why the original poster is “trialing” that old version, but I’m quite confident that I know the reason.

1 Like

Thanks for the reply,
6.2.2 is the version the person I’m making for is using, I’m going in pretty blind to this software but it looks like a powerful bit of kit.
I’ve made similar for http out of virtualdj into BreakawayOne, this case is again out of virtualdj, so I’ve used the same code.

I’m more doubting myself then I am you, but from your browser does that string start the automation for you? Could you check please?

With the prefix HTTP POST: my browser just takes me to a google search.
If I omit that prefix [which I’ve not seen used in browser access before] I get “The requested resource was not found”
And I believe I’m connected as if I use wrong credentials it will constantly request the right credentials

I believe this is everything for permissions
[username & password are different to what I posted in the forum but I used hello:app as credentials]

I’m currently using browser just to get a grip with it, a browser is as REST as anything else.
I can post c++ code if needs be, but I’m pretty sure if I can do it with browser I can quit bothering you.

There aren’t any REST limitations on the trial version are there?
Again thanks for the reply.

Please send a screenshot of the License Manager main window to support@mairlist.com so we can check what is included in your trial license.

@ Torben

I assure you I have no interest in ripping you off, I am genuinely a plugin developer for virtualdj.

Sure I’ll screenshot and send.
Just for proof I’m genuine he’s my c++ for the vdj API

#include "StartStopBasic.h"

HRESULT VDJ_API CStartStopBasic::OnLoad()
{
	DeclareParameterButton(&button1, BUTTON_1, "BUTTON 1", "B1");
	return S_OK;
}
HRESULT VDJ_API CStartStopBasic::OnGetPluginInfo(TVdjPluginInfo8* infos)
{
	infos->Author = "LocoDog";
	infos->PluginName = "mAirlist";
	infos->Description = "Custom HTTP for djryandavies";
	infos->Version = "1.0.0";
	return S_OK;
}
ULONG VDJ_API CStartStopBasic::Release()
{
	delete this;
	return 0;
}
HRESULT VDJ_API CStartStopBasic::OnStart()
{
	//Setup Connection
	WSAData wsaData;
	WORD DllVersion = MAKEWORD(2, 1);
	if (WSAStartup(DllVersion, &wsaData) != 0) exit(1);
	memset(&addr, 0, sizeof(addr));
	addrLen = sizeof(addr);
	addr.sin_addr.s_addr = inet_addr("127.0.0.1");
	addr.sin_port = htons(9300);
	addr.sin_family = AF_INET;

	connection = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
	if (connect(connection, (SOCKADDR*)&addr, addrLen) == 0) {
		closesocket(connection);
	}
	else {
		SendCommand("deck master repeat_start 'quickOff' 100ms 1 & effect_active 'mAirlist' off");
		memset(&addr, 0, sizeof(addr));
	}
	return S_OK;
}
HRESULT VDJ_API CStartStopBasic::OnStop()
{
	closesocket(connection);
	WSACleanup();
	return S_OK;
}
HRESULT VDJ_API CStartStopBasic::OnParameter(int id)
{
	switch (id)
	{
	case BUTTON_1:
	{
		if (button1) {
			std::stringstream cmd1;
			    //AUTOMATION%201%20NEXT
			cmd1 << "POST /execute?command=ALL%20PLAYERS%20START HTTP/1.1\r\nHost: hello:app@127.0.0.1\r\n\r\n";
			std::string getInput = cmd1.str().c_str();
			int dataSize = getInput.size();
			int totalBytesSent = 0;

			connection = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
			//if (connect(connection, (SOCKADDR*)&addr, addrLen) == 0) {
			//	send(connection, getInput.c_str(), strlen(getInput.c_str()), 0);
			//	closesocket(connection);
			//}
			// better?
			while (totalBytesSent < dataSize) {
				int bytesSent = send(connection, getInput.c_str() + totalBytesSent, dataSize - totalBytesSent, 0);
				if (bytesSent == SOCKET_ERROR) {
					int errorCode = WSAGetLastError();
					closesocket(connection);
					break;
				}

				totalBytesSent += bytesSent;
			}
			closesocket(connection);


		}break;
	}
	default:
		break;
	}
	return S_OK;

}
HRESULT VDJ_API CStartStopBasic::OnGetParameterString(int id, char* outParam, int outParamSize)
{
	return E_NOTIMPL;
}

A post was split to a new topic: Sicherungskopie Thread

I was asked for licencing proof, and I believe I sent that in my last email, can the discussion continue?

You should not add “HTTP POST” in your browser’s address line, but you should send the command via http post.

This is hardly possible from a browser (maybe with plug-ins for debugging purposes).

Hth,
Christoph