Hi there, I’ve been asked to make a thing that sends a HTTP put requests thru local host from a dj software into mairlist 6.2.2
I believe I have it connecting.
Just not sure on the syntax for anonymous users or how to enable them [config looks different to the wiki]
This is the meat of my c++ code, using WinSock2 since I made something similar for BreakAwayOne
Thanks for reading
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");
// if the initial connection failed it would turn itself off here
memset(&addr, 0, sizeof(addr));
}
// CODE HAS BEEN TRUNCATED FOR READABILITY
// MY BUTTON PRESS
if (button1)
{
std::stringstream cmd1;
cmd1 << "POST /execute/ALL%20PLAYERS%20START" " HTTP/1.1\r\nHost: 127.0.0.1\r\n\r\n";
std::string getInput = cmd1.str().c_str();
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);
}
}