jcageman/d2mapapi

host it in a cloud

JohnStyleZ opened this issue · 5 comments

to host it in a cloud, do i use the public ip address of my vps instead of localhost?

To reach the mapapi yes. Note that the webapi itself should probably run on 0.0.0.0 and for example port 80.
See for example the azure document for appservice: https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-port-number which by default only has port 80 and 443 (SSL) open. For your cloud provider you also need to figure out which port is opened on your VPS. To read up on the 0.0.0.0 check https://stackoverflow.com/questions/38834434/how-are-127-0-0-1-0-0-0-0-and-localhost-different

can you release a bat file thats listening to 0.0.0.0 ?

The command line for it is in the readme :) See: https://github.com/jcageman/d2mapapi#examples

its working now, i wonder how many connections can it handle?

Not too many, because it can only process loading one map at a time (so another client has to wait until anoter client processed his request). This is due to the locking the code is doing:
with std::scoped_lock to prevent concurrent modifications. The issue is that you cannot load multiple things at the same time via the diablo dll's. If you want to support many connections, you probably have to think about hosting this process on multiple small servers or via dockers for example and routing traffic to one of these at a time. Ps. i've ran about 10 concurrent connections with many requests and that still works fine, but i think with 20 or more that will probably give issues.