In the project root folder use the command:
dotnet run
By default, it will run on locahost:5000, to change the ip/port:
dotnet run --urls "http://ip:port"
You can also edit & use Start.bat, it will bind to all interfaces and listen on port 27015
You will most likely have to setup port-forwarding if you want the web bridge to be accessed remotely.
Ctrl+C to exit.
I realize that this might be important to outline:
Using this web bridge requires revealing your computer's public IP to the program that will interface with it.
I 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.
Each toy type can have a custom configuration in the ToySettings section of appsettings.json.
Using multiple identical devices is supported and duplicates will show as "Devicename 2" , "Devicename 3" and so on. There is currently no way to uniquely identify each device under the ButtPlug API, so they are registered on a first come, first served basis.
Examples use localhost:5000 as the Toy Web Bridge address and "Lovense Hush" as the device.
The device APIs have general structure of /api/Device/{Action}/{Devicename}/{argument}
and is defined in Controllers/DevicesController.cs
GET http://localhost:5000/api/Device/List
GET http://localhost:5000/api/Device/Info/Lovense%20Hush
Currently returns supported features for the queried device
GET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/0
GET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/50
GET http://localhost:5000/api/Device/VibrateCmd/Lovense%20Hush/100
Note: You have to set the speed of all vibrators at once, the number of supplied values MUST match VibrateCmd Feature.
Example for VibrateCmd = 1:
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/0
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/50
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Hush/100
Example for VibrateCmd = 2:
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/0,100
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/50,50
GET http://localhost:5000/api/Device/SingleMotorVibrateCmd/Lovense%20Edge/100,0
Devices that support VibrateCmd can play vibration sequences with "SequenceVibrateCmd". Unlike the other commands, this one requires to use a JSON encoded POST query.
Example:
POST http://localhost:5000/api/Device/SequenceVibrateCmd/Lovense%20Edge
Payload example (single/all motors): ( raw/JSON )
{
"Loop":false,
"Time":[500,500,500,500],
"Speeds":[
[10,0,50,0]
]
}
Payload example (two independent motors): ( raw/JSON )
{
"Loop":true,
"Time":[500,500,500,500],
"Speeds":[
[10,0,50,0],
[0,10,0,50]
]
}
GET http://localhost:5000/api/Device/StopDeviceCmd/Lovense%20Hush
Errors are indicated with HTTP response status codes.
The command/query has been executed successfully.
The requested device doesn't support this function.
Access denied, make sure that you supplied a valid access key.
The requested device doesn't exist (or the URL is invalid).
Toy Web Bridge is licensed under CC BY-NC-SA 4.0