Page 1 of 1

Network access in mods ?

Posted: Tue Jan 06, 2026 4:11 am
by dewitpj
Hi,

I did a very quick Google and found that mods don't have access to networking (I'm looking for a simple HTTP(s) client) - is this true ? If so, is this something that will be considered in the future ?

Thanks !

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 4:40 am
by eugenekay
Some reasons this will never happen:
  • Allows for data exfiltration from the game sandbox by smuggling it in the request body
  • Multiple clients making HTTP requests (in multiplayer) could get different responses from the server, causing desyncs
  • Latency of waiting for a response would make for an awful user experience
The best you can do is write_file to the script-output/ folder. On multiplayer servers you can use the RCON interface to run console commands, including LUA scripts. There is also send_udp / recv_udp which requires the data to be replicated to all multiplayer users.

Good Luck!

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 6:06 am
by dewitpj
Sorry, but you answer seems to focus a lot on multiplayer - my focus is way more on single player. The idea is that you have 2 or more players and using this mod, you can share resources between players. Players will need to load said resources into a train and send it to a station. The train (including resources) will then "disappear" from the player's map and spawn on the target players map, where it will go towards a station, rinse repeat.

The network parts will be the exchange of resources, so no real player XP impact that I can see?

Does the mod code not run in it's own thread ?

Thanks !

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 2:00 pm
by Rseding91
dewitpj wrote: Tue Jan 06, 2026 6:06 am Does the mod code not run in it's own thread ?
It does not.

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 2:39 pm
by eugenekay
dewitpj wrote: Tue Jan 06, 2026 6:06 am Sorry, but you answer seems to focus a lot on multiplayer - my focus is way more on single player. The idea is that you have 2 or more players and using this mod, you can share resources between players.
Singleplayer and multiplayer follow the exact same game logic - the player’s character controller is just “local”.

You may find Subspace Storage and Clusterio interesting.

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 3:18 pm
by dewitpj
eugenekay wrote: Tue Jan 06, 2026 2:39 pm
dewitpj wrote: Tue Jan 06, 2026 6:06 am Sorry, but you answer seems to focus a lot on multiplayer - my focus is way more on single player. The idea is that you have 2 or more players and using this mod, you can share resources between players.
Singleplayer and multiplayer follow the exact same game logic - the player’s character controller is just “local”.

You may find Subspace Storage and Clusterio interesting.
Oh I see - thanks !

I see we have (as you mentioned) send_udp,recv_udp - even thou this seems to only be "bound" to localhost I can still use this - TO THE LAB ! :)

Re: Network access in mods ?

Posted: Tue Jan 06, 2026 3:18 pm
by dewitpj
Rseding91 wrote: Tue Jan 06, 2026 2:00 pm
dewitpj wrote: Tue Jan 06, 2026 6:06 am Does the mod code not run in it's own thread ?
It does not.
Thanks !