{"id":13778657,"url":"https://github.com/kyrahabattoir/ToyWebBridge","last_synced_at":"2025-05-11T12:31:17.350Z","repository":{"id":53876398,"uuid":"306993771","full_name":"kyrahabattoir/ToyWebBridge","owner":"kyrahabattoir","description":"A simple web bridge for https://buttplug.io/","archived":false,"fork":false,"pushed_at":"2021-12-22T21:42:48.000Z","size":121,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T18:13:10.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kyrahabattoir.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-25T00:06:33.000Z","updated_at":"2024-05-28T07:48:54.000Z","dependencies_parsed_at":"2022-08-28T15:42:31.464Z","dependency_job_id":null,"html_url":"https://github.com/kyrahabattoir/ToyWebBridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyrahabattoir%2FToyWebBridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyrahabattoir%2FToyWebBridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyrahabattoir%2FToyWebBridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kyrahabattoir%2FToyWebBridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kyrahabattoir","download_url":"https://codeload.github.com/kyrahabattoir/ToyWebBridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225048974,"owners_count":17412902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:00:55.755Z","updated_at":"2024-11-17T14:30:44.962Z","avatar_url":"https://github.com/kyrahabattoir.png","language":"C#","funding_links":[],"categories":["Virtual Worlds"],"sub_categories":["Terraria"],"readme":"# Toy Web Bridge\n\n# Running\nIn the project root folder use the command:\n```dotnet run```\n\nBy default, it will run on locahost:5000, to change the ip/port:\n```dotnet run --urls \"http://ip:port\"```\n\nYou can also edit \u0026 use Start.bat, it will bind to all interfaces and listen on port 27015\n\nYou will most likely have to setup port-forwarding if you want the web bridge to be accessed remotely.\n\nCtrl+C to exit.\n\n# Safety\nI realize that this might be important to outline:\n\nUsing this web bridge **requires revealing your computer's public IP** to the program that will interface with it.\n\nI made this program to control toys from \"Second Life\" scripts which effectively act as a 3rd party \"anonymity buffer\", this solution is acceptable for me, but might not be for you, please be safe.\n\n## Security\n* You can set a **SecretKey** in **appsettings.json**.\n* If no **SecretKey** is set, a temporary key will be generated (and displayed in the console window).\n* To connect to the Web bridge, apps have to supply a header parameter named \"SecretKey\" with the proper value.\n\n## Per toy configuration.\nEach toy type can have a custom configuration in the ToySettings section of **appsettings.json**.\n* (Optional) CommandDelay: By default, the maximum command rate is 50ms. You can set a longer value for a specific toy here.\n* (Optional) PowerFactor: By default, You can limit the actual power range of a toy here, if 100% is too strong.\n* (Optional) VisibleName: The toy will be identified under this name rather than the device name (useful for privacy).\n\n## Using multiple identical devices\nUsing multiple identical devices is supported and duplicates will show as \"Devicename 2\" , \"Devicename 3\" and so on.\nThere is currently no way to uniquely identify each device under the ButtPlug API, so they are registered on a first come, first served basis.\n\n## API\nExamples use localhost:5000 as the Toy Web Bridge address and \"Lovense Hush\" as the device.\n\n### Devices\nThe device APIs have general structure of `/api/Device/{Action}/{Devicename}/{argument}`\nand is defined in `Controllers/DevicesController.cs`\n\n#### Get a list of devices\n```\nGET http://localhost:5000/api/Device/List\n```\n\n#### Querying a specific device status\n```\nGET http://localhost:5000/api/Device/Info/Lovense%20Hush\n```\nCurrently returns supported features for the queried device\n\n#### Set global vibration level (all vibration motors)\n```\nGET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/0\nGET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/50\nGET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/100\n```\n\n#### Set vibration level on each vibrator independently\nNote: You have to set the speed of all vibrators at once, the number of supplied values MUST match VibrateCmd Feature.\n\nExample for VibrateCmd = 1:\n```\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/0\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/50\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/100\n```\n\nExample for VibrateCmd = 2:\n```\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/0,100\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/50,50\nGET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/100,0\n```\n\n#### Play a vibration sequence\nDevices that support VibrateCmd can play vibration sequences with \"SequenceVibrateCmd\".\nUnlike the other commands, this one requires to use a JSON encoded POST query.\n\n* A \"Time\" list indicates how long each sequence step takes.\n* You can control each motor independently, if only only one motor instruction list is sent,\nit is assumed that you want all motors to be controlled at the same time.\n* For devices with more than 2 independent motors (is there any?), ommited entries are treated as 0.\n\nExample:\n```\nPOST http://localhost:5000/api/Device/SequenceVibrateCmd/Lovense%20Edge\n```\nPayload example (single/all motors): ( raw/JSON )\n```\n{\n   \"Loop\":false,\n   \"Time\":[500,500,500,500],\n   \"Speeds\":[\n      [10,0,50,0]\n   ]\n}\n```\nPayload example (two independent motors): ( raw/JSON )\n```\n{\n   \"Loop\":true,\n   \"Time\":[500,500,500,500],\n   \"Speeds\":[\n      [10,0,50,0],\n      [0,10,0,50]\n   ]\n}\n```\n* If \"Loop\" is true, the pattern will repeat until a new instruction is received.\n* When a sequence ends, the motors will keep running at the last \"Speed\" value.\n* Missing \"Speed\"values will be considered 0, \"Time\" determinates the sequence length.\n\n#### Shut down the device\n```\nGET http://localhost:5000/api/Device/StopDeviceCmd/Lovense%20Hush\n```\n\n#### Status Codes\nErrors are indicated with HTTP response status codes.\n\n##### 200 Ok\nThe command/query has been executed successfully.\n\n##### 400 Bad Request\nThe requested device doesn't support this function.\n\n##### 401 Unauthorized\nAccess denied, make sure that you supplied a valid access key.\n\n##### 404 Not Found\nThe requested device doesn't exist (or the URL is invalid).\n\n## License\n\nToy Web Bridge is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)\n\n![CC BY-NC-SA 4.0](https://i.imgur.com/BlZ8chD.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyrahabattoir%2FToyWebBridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyrahabattoir%2FToyWebBridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyrahabattoir%2FToyWebBridge/lists"}