jakob / sloxy Goto Github PK
View Code? Open in Web Editor NEWA slow TCP proxy
License: MIT License
A slow TCP proxy
License: MIT License
> make sloxy
cc sloxy.c -o sloxy
sloxy.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <stdlib.h>
^~~~~~
sloxy.c:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <stdio.h>
^~~~~~
sloxy.c:3:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <strings.h>
^~~~~~
sloxy.c:4:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/types.h>
^~~~~~
sloxy.c:5:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/uio.h>
^~~~~~
sloxy.c:6:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/socket.h>
^~~~~~
sloxy.c:7:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/un.h>
^~~~~~
sloxy.c:8:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/select.h>
^~~~~~
sloxy.c:9:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <sys/time.h>
^~~~~~
sloxy.c:10:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <netdb.h>
^~~~~~
sloxy.c:11:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <unistd.h>
^~~~~~
sloxy.c:12:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <arpa/inet.h>
^~~~~~
sloxy.c:13:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <math.h>
^~~~~~
sloxy.c: In function ‘main’:
sloxy.c:62:19: error: ‘struct sockaddr_in’ has no member named ‘sin_len’; did you mean ‘sin_zero’?
listen_sockaddr->sin_len = sizeof *listen_sockaddr;
^~~~~~~
sin_zero
sloxy.c:133:21: error: ‘struct sockaddr_in’ has no member named ‘sin_len’; did you mean ‘sin_zero’?
target_sockaddr->sin_len = sizeof *target_sockaddr;
^~~~~~~
sin_zero
sloxy.c: In function ‘readwrite’:
sloxy.c:198:2: warning: implicit declaration of function ‘nanosleep’; did you mean ‘usleep’? [-Wimplicit-function-declaration]
nanosleep(&tv, NULL);
^~~~~~~~~
usleep
<builtin>: recipe for target 'sloxy' failed
make: *** [sloxy] Error 1
I tried to use sloxy to add 1 second latency to https websocket but I experience timeout when connecting to it with Firefox:
Sloxy log looks normal:
> ./sloxy 127.0.0.1 10443 127.0.0.1 8443 100000 1
Delay: 1000ms
Speed Limit: 100KB/s
Buffer Size: 100000 bytes
Listening on 127.0.0.1:10443
Connecting to 127.0.0.1:8443
Connected.
OS Ubuntu 18.04
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.