Allow C# Libraries on the Server to make HTTP Requests and Use Websockets freely

I wanted to call an HTTP API, so I did what every single developer could think of: used what .NET Framework provides or downloaded a library from NuGet.

After trying both solutions, I found that my script was crashing not because I was doing something wrong, but because it was being blocked by the CFX Server itself (the same snippet worked on a console app).

Now, I know why this might be a good idea on the Client, but on the Server? You end up having to use terrible solutions that can be avoided altogether by just lifting a limitation on the Server itself.

It isn’t though?

There’s no such ‘limitation’. The server is entirely unsandboxed and includes a lot more (and more recent) Mono libraries compared to the client.

Post a support topic instead, maybe, though it seems like you just need clr_disable_task_scheduler?

Not a feature request but rather a support question masking as a feature request due to an… assumption?

Locked, therefore.

… actually makes more sense to move it to RD&M/D.

You say that disabling the Task Scheduler should fix it, so technically is limited by something. Also, if it breaks things in the base .NET Framework classes (System.Net.Http.HttpClient, System.Net.HttpWebRequest, System.Net.WebClient and System.Net.WebRequest), it should be disabled by default.

No, it shouldn’t, as that’d break compatibility with older resources that don’t expect to not automatically marshal to the main thread, and it’s not possible to say ‘hey, this resource was first written way after this date, so it makes sense to disable it by default for this resource’.

Not really? ‘limited’ would mean ‘something you can’t change’ which also makes no sense in the first place since this is an open-source project…

New fx_version with clr_disable_task_scheduler set to yes by default, simple. It does not affect old scripts.

A quick Google search shows that the definition of “limited” is not that.

I agree!

The new FXv2 version bodacious has clr_disable_task_scheduler set to yes by default.