-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The final luasocket API and its documentation #10
Open
tcz717
wants to merge
33
commits into
luainkernel:master.old
Choose a base branch
from
tcz717:luasocket-with-docs
base: master.old
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+8,747
−5
Conversation
This file contains 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
- Change bindings to return error code instead of string - Add flag enums
tcz717
changed the title
The final luasocket API and its documents
The final luasocket API and its documentation
Aug 6, 2018
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
,TCP
andUDP
. I/O multiplex API,poll
is 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_64
Compile with
luadata
andpoc driver
enabled:make -C /lib/modules/$(uname -r)/build M=LUNATIC_ROOT_PATH modules ARCH=x86_64 CONFIG_LUADATA=y CONFIG_LUNATIK_POC=y
Or 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:
qemu
x86_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