Skip to content

Split net library into client and server#717

Closed
Nicell wants to merge 1 commit into
luau-lang:primaryfrom
Nicell:split-net-client-server
Closed

Split net library into client and server#717
Nicell wants to merge 1 commit into
luau-lang:primaryfrom
Nicell:split-net-client-server

Conversation

@Nicell
Copy link
Copy Markdown
Collaborator

@Nicell Nicell commented Jan 11, 2026

I'd like to get websockets in upstream, as I've been using my branch of it for a bit with success. First, though, splitting net into server and client should make it cleaner and easier to review the upcoming websocket PRs... Also the file was getting really long.

Comment thread lute/net/src/client.cpp
Comment on lines +237 to +264
int luaopen_net(lua_State* L)
{
globalCurlInit();

luaL_register(L, "net", net::lib);

return 1;
}

int luteopen_net(lua_State* L)
{
globalCurlInit();

lua_createtable(L, 0, std::size(net::lib));

for (auto& [name, func] : net::lib)
{
if (!name || !func)
break;

lua_pushcfunction(L, func, name);
lua_setfield(L, -2, name);
}

lua_setreadonly(L, -1, 1);

return 1;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environment setup seems to be broken now with how they're split. I want to make all of the modules/submodules for the runtime libraries more uniform here, but in general, we should have open for @lute/net/client and open for @lute/net/server and an open for @lute/net that, at the very least, exposes those two tables as client and server within it.

@Nicell Nicell closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants