You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Slight modification to Dockerfile to include `requirements.txt`, as
well as modify copy/`pip` locations to reduce reinstalling on every
change/build. Speeds up dev cycle a bit.
* Updated `requirements.txt` to include `aiohttp_cors`
* Server port updated from 4445 -> 4456 to keep in vain of ws+1
* `config.ini` Changes:
* Changed port 4444 -> 4455 to match obs-websocket v5 default
* Added `cors_domains`, which is a comma-separated list
* `docker-compose.yml` Changes:
* Moved comments as they were getting long
* Updated values to match new `config.ini` changes
* Added `extra_hosts` section to properly route DNS to local
Host IP, allowing easier connectivity
* `entrypoint.sh` Changes:
* Updated to add and sed replace `cors_domains`
* `main.py` Changes:
* Added Parser configs for `cors_domains`, defaulting to
wildcard (`*`)
* Added some logging to show CORS domains accepted
* Added some logging to show bindAddress and port for user's
sake
* ***Re-added loop***... I know this was removed, but after
looking at how aiohttp works, it will create it's own event
loop and mess everything up if not included. Since the main event loop
is being used to run `init`, it's necessary to inject into `web.run_app`
to use the same event loop or all requests to obs will timeout. Maybe
there's a better way to do this, but I am not a Python dev to know
better.
* Added method to iterate over supplied CORS Domains and add the
routes as accepted from said domains.
You can test this from a codepen example I built getting the OBS
version: https://codepen.io/CodexHere/full/ZEqYLVX
To validate, simply set `cors_domains` to any invalid value, such as
"none" and restart the server.
Copy file name to clipboardExpand all lines: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,14 @@ A request type is always required, however the request body is optional, and is
34
34
For a list of request types, refer to the [obs-websocket protocol docs](https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#requests)
If you receive errors about CORS and not having `Access-Control-Allow-Origin` header for the endpoint, be sure to modify `config.ini` or `docker-compose.yml` to properly set `cors_domains`.
43
+
44
+
> A domain of `*` will allow *ALL* domains privileges to make successful requests, so use it at your own risk. Either configure appropriately, or use an Auth key for the HTTP configuration.
0 commit comments