Tim_F thank you from heart, you're really kind to write that script, I haven't imagine it was so complicated to send a string. I really hope this script can be useful to other people, I think to have a simple web page (runnng o all platforms without installing nothing) with photos/icons of different scenes makes very simple to change them, a useful remote. When it will works I'll try to open a project to share it to the community.
I've tested it and unfortunately it doesn't work, I've debug it with a sniffere and I've found this:
The browser send the command but I think it misses the object cotaining scene:
E +q@À¨À¨¦FQ&´ô×P²çOPTIONS /emit/SetCurrentScene HTTP/1.1
Host: 192.168.24.2:81
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
Accept: */*
Accept-Language: it-IT,it;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: null
Connection: keep-alive
The small http server replies this:
Eâ+v@À¨À¨Q¦F´ô×P²)HTTP/1.1 405 Method Not Allowed
Content-Type: text/plain; charset=utf-8
Allow: POST
Content-Length: 23
Date: Sat, 01 May 2021 09:47:09 GMT
Server: Python/3.8 aiohttp/3.7.4.post0
I'm using:
A Python-based program that provides HTTP endpoints for obs-websocket - IRLToolkit/obs-websocket-http
github.com
Here what the author says:
This code contains two request endpoints. /emit/{requesttype} and /call/{requesttype}.
- /emit/{requesttype} sends off a websocket event without waiting for a response, and immediately returns a generic {"status":"ok"} json response after sending the event, regardless of whether it errors out on the OBS instance.
- /call/{requesttype} Makes a full request to obs-websocket, and waits for a response. The recieved response is then returned to the HTTP caller.
If authentication is set, then each request much contain an AuthKey header with the configured password as the value.
A request type is always required, however a json body depends on the underlying request in obs-websocket as to whether any data is necessary.
For a list of request types, refer to the
obs-websocket protocol docs
Example cURL commands: