Lua Socket: Difference between revisions

From Spring
Jump to navigationJump to search
Abma (talk | contribs)
Abma (talk | contribs)
Line 3: Line 3:
All LuaSocket related config is readonly for LuaWidgets. They can be only changed through unitsync.
All LuaSocket related config is readonly for LuaWidgets. They can be only changed through unitsync.


As default, socket access is restricted, as default no connections are allowed. To allow a connection / sending a packet, the destination has to the corresponding allow rule. For example, if a lua widget wants to connect to springrts.com at port 80,
<code><pre>TCPAllowConnect springrts.com:80</pre></code>
has to be set.


{|
{|

Revision as of 10:42, 28 March 2012

config settings

All LuaSocket related config is readonly for LuaWidgets. They can be only changed through unitsync.

As default, socket access is restricted, as default no connections are allowed. To allow a connection / sending a packet, the destination has to the corresponding allow rule. For example, if a lua widget wants to connect to springrts.com at port 80,

TCPAllowConnect springrts.com:80

has to be set.

LuaSocketEnabled = 1 Default is 0 means, all Socket functions are disabled
TCPAllowConnect allow TCP-connections to the listed hosts, for example: "springrts.com:80 springfiles.com:80" which allows luasockets to connect to springrts.com at port 80 and springfiles.com at port 80.
TCPAllowListen Server TCP-sockets are allowed on this port, for example: "localhost:1234 0.0.0.0:12345"
UDPAllowConnect see TCPAllowConnect
UDPAllowConnect see TCPAllowListen

example code

Notes / known issues / TODO

documentation

links

compiled Spring test version forum thread