I found a very interesting post on self hosted Rust apps, they look good.
I am interested on how to host it in a web server like IIS, or is it impossible at the moment?
I found a very interesting post on self hosted Rust apps, they look good.
I am interested on how to host it in a web server like IIS, or is it impossible at the moment?
Yes, it is possible to host a Rust application in IIS.
I used the same approach used to host Suave applications in IIS and it worked.
On IIS the key is to read the port where IIS expects your application to listen
let port = match env::var("HTTP_PLATFORM_PORT") {
Ok(val) => val,
Err(e) => "6767".to_string(),
};
I created a small crate iis
to make it easier to use in a real Rust application like here for Nickel
let port = iis::get_port();
let listen_on = format!("127.0.0.1:{}", port);
server.listen(listen_on);
I believe this would be mature enough for production exactly the same way self hosted Rust app given HttpPlatformHandler and IIS are mature and stable.
I also did some very basic and unscientific performance tests on the Free App Service plan in Azure and got stable roughly 60 hits per second with avg. response time 100-200 ms.