The final luasocket API and its documentation#10
Open
tcz717 wants to merge 33 commits intoluainkernel:master.oldfrom
Open
The final luasocket API and its documentation#10tcz717 wants to merge 33 commits intoluainkernel:master.oldfrom
tcz717 wants to merge 33 commits intoluainkernel:master.oldfrom
Conversation
- Change bindings to return error code instead of string - Add flag enums
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lunatik Socket Library
The Lunatik socket library is developed by Chengzhi Tan (@tcz717). It provides most frequently used APIs that available for
IPv4,TCPandUDP. I/O multiplex API,pollis also included in this library. The testcase file issocket/examples/test.lua.Compile
Compile the kernel module:
make -C /lib/modules/$(uname -r)/build M=LUNATIC_ROOT_PATH modules ARCH=x86_64Compile with
luadataandpoc driverenabled:make -C /lib/modules/$(uname -r)/build M=LUNATIC_ROOT_PATH modules ARCH=x86_64 CONFIG_LUADATA=y CONFIG_LUNATIK_POC=yOr see the wiki to use BuildRoot.
SOCKSv4 Demo
This demo shows how to run a SOCKSv4 proxy server in kernel. After the lunatik module loaded, type
cat proxy.lua > /dev/luadrv. Then the server will start to listen SOCKSv4 request at 8080 port. (The path of the demo file issocket/examples/proxy.lua)Benchmark
The speed of the proxy demo is tested.
Environment
Server:
qemux86_64 virtual machine running Linux 4.17.0Client: the host of
qemu, Ubuntu 18.04/Linux 4.15.0The proxy server is running inside a QEMU virtual machine, which can access the Internet via NAT and forwards 8080 port on the host. After the proxy starts, the client on the host will use the proxy to download a fake zip file from a remote server.
Method
Use proxy to download two file 5MB and 100MB (The average ping is 96.904ms):
Result