diff --git a/game/engine/Module.lua b/game/engine/Module.lua
index 2dc513b315549c14efb28fef6e7c8a30ecdbc44d..2af05773463423a32e31669303e8a2cae37eab6f 100644
--- a/game/engine/Module.lua
+++ b/game/engine/Module.lua
@@ -166,7 +166,6 @@ function _M:loadRemoteList(src)
 	local l = lanes.linda()
 
 	function list_handler(src)
-		require "socketed"
 		local http = require "socket.http"
 		local ltn12 = require "ltn12"
 
diff --git a/game/engine/dialogs/DownloadDialog.lua b/game/engine/dialogs/DownloadDialog.lua
index 87574aba6b337bc653261a7747284a91e3e2bafa..f4eb9b7ec2304ac97500d6f82f0085e3fe49f34c 100644
--- a/game/engine/dialogs/DownloadDialog.lua
+++ b/game/engine/dialogs/DownloadDialog.lua
@@ -64,7 +64,6 @@ function _M:startDownload()
 	local l = lanes.linda()
 
 	function list_handler(src)
-		require "socketed"
 		local http = require "socket.http"
 		local ltn12 = require "ltn12"
 
diff --git a/game/engine/pre-init.lua b/game/engine/pre-init.lua
index 3af3e8689c63af47951716bd9f76dc878894bd22..541ce8625e33c3584eb82a663476afd216912d4a 100644
--- a/game/engine/pre-init.lua
+++ b/game/engine/pre-init.lua
@@ -26,7 +26,3 @@ if jit then
 else
 	print("LuaVM:", _VERSION)
 end
-
--- Requiring "socketed" instead of "socket" makes sockets work
--- Thsi is due to the way luasocket is embeded statically in TE4
-require "socketed"
diff --git a/game/thirdparty/socket.lua b/game/thirdparty/socket.lua
index 89a71ee0b7ed2af023a6f24a0232d5c3f935c229..f4c9d4858ca7e0686e1cf6daa667646cf3a5b92b 100644
--- a/game/thirdparty/socket.lua
+++ b/game/thirdparty/socket.lua
@@ -10,7 +10,7 @@
 local base = _G
 local string = require("string")
 local math = require("math")
-local socket = require("socket")
+local socket = require("socketcore")
 module("socket")
 
 -----------------------------------------------------------------------------
diff --git a/game/thirdparty/socketed.lua b/game/thirdparty/socketed.lua
deleted file mode 100644
index 548f6422275ddba4e006bb76e24bb251dd394a01..0000000000000000000000000000000000000000
--- a/game/thirdparty/socketed.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-local print = print
-local dofile = dofile
-local socket = require("socket")
-
-module("socketed")
-
-if not socket.connect then
-	dofile("/socket.lua")
-end
-
-return socket
diff --git a/src/luasocket/luasocket.c b/src/luasocket/luasocket.c
index 11ffee94c46ff834d9a91aa2e3c3b3c90c9a0fbe..2991a653a211f1387e21901aa66d6faad590a61e 100644
--- a/src/luasocket/luasocket.c
+++ b/src/luasocket/luasocket.c
@@ -89,7 +89,10 @@ static int global_unload(lua_State *L) {
 static int base_open(lua_State *L) {
     if (socket_open()) {
         /* export functions (and leave namespace table on top of stack) */
-        luaL_openlib(L, "socket", func, 0);
+	lua_newtable(L);
+	luaL_register(L, "socketcore", func);
+	lua_setglobal(L, "socket");
+	lua_getglobal(L, "socket");
 #ifdef LUASOCKET_DEBUG
         lua_pushstring(L, "_DEBUG");
         lua_pushboolean(L, 1);