mineflayer-statemachine icon indicating copy to clipboard operation
mineflayer-statemachine copied to clipboard

make webserver stoppable once created

Open kaduvert opened this issue 2 years ago • 4 comments

If the bot starting process includes creating a webserver you can't replay it because the default port is already bound and can't be freed this pr makes freeing possible by adding a stopServer() method

That's useful if you have to recreate your bot sometimes (possibly due to disconnects) but don't want to recreate the whole node process

kaduvert avatar Dec 12 '23 18:12 kaduvert

not sure on whether to merge more things like this here vs merging one of the massive PRs open

rom1504 avatar Dec 17 '23 18:12 rom1504

do both. the open prs don't conflict with each other except for maybe #175, but that's another project anyways..

kaduvert avatar Dec 17 '23 19:12 kaduvert

I need it, sometimes I check the bot to see how it is, but I could launch a task if there is no open connection that automatically stops the service, to improve performance/consumption

sefirosweb avatar Mar 16 '24 18:03 sefirosweb

I'd like this merged as well. I have a long lived mineflayer node instance, and the bot joins/leaves the server in sync with when another program connects/disconnects to it via websocket.

Not being able to close the webserver means the webserver is stuck with the first bot (cant keep the same bot instance as it cannot disconnect and creating one instantly joins a server).

ozaner avatar Aug 04 '24 21:08 ozaner