I compiled luasocket with Lua 5.3 using the latest 3.0-rc1 version by adding -DLUA_COMPAT_APIINTCASTS to the build flags.