updated code for chapter 11 FD

master
peshwar9 3 years ago
parent 62e9b4b475
commit b6bc90da6c

@ -9,7 +9,7 @@ fn main() {
let args: Vec<_> = env::args().collect();
if args.len() < 3 {
eprintln!("Please provide proxy-from and proxy-to addresses");
exit(0);
exit(2);
}
let proxy_server = &args[1];
let origin_server = &args[2];
@ -22,13 +22,13 @@ fn main() {
let port = proxy_listener.local_addr().unwrap().port();
if let Err(_err) = TcpStream::connect(origin_server) {
println!("Please re-start the origin server");
exit(0);
exit(1);
}
println!("Running on Addr:{}, Port:{}\n", addr, port);
} else {
eprintln!("Unable to bind to specified proxy port");
exit(0);
exit(1);
}
let mut thread_handles = Vec::new();

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":4144718664990317059,"profile":14891217944882224483,"path":1971126846978498487,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-07fe34c963205a5d/dep-bin-origin-07fe34c963205a5d"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":4144718664990317059,"profile":14996655781355331481,"path":1971126846978498487,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-0e565eccfa6e52a0/dep-bin-origin-0e565eccfa6e52a0"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":4144718664990317059,"profile":1647870076477133176,"path":1971126846978498487,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-5c775a8d016ab106/dep-test-bin-origin-5c775a8d016ab106"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":14075220824509603138,"profile":14996655781355331481,"path":7826526257089709771,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-b33cede9d22ae3ee/dep-bin-proxy-b33cede9d22ae3ee"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":5317751864117190695,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-bc5b79807d74c314/dep-test-bin-tcpproxy-bc5b79807d74c314"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":14075220824509603138,"profile":1647870076477133176,"path":7826526257089709771,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-e2b40a5fbef4cfc6/dep-test-bin-proxy-e2b40a5fbef4cfc6"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":14075220824509603138,"profile":14891217944882224483,"path":7826526257089709771,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-f38f9f2c2cdd137a/dep-bin-proxy-f38f9f2c2cdd137a"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":5317751864117190695,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/tcpproxy-f6c45a41f08d6bd4/dep-bin-tcpproxy-f6c45a41f08d6bd4"}}],"rustflags":["-C","prefer-dynamic","-C","rpath"],"metadata":13779719443416291531}

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-07fe34c963205a5d.rmeta: src/bin/origin.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-07fe34c963205a5d.d: src/bin/origin.rs
src/bin/origin.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-0e565eccfa6e52a0: src/bin/origin.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-0e565eccfa6e52a0.d: src/bin/origin.rs
src/bin/origin.rs:

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.origin-0e565eccfa6e52a0</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-5c775a8d016ab106.rmeta: src/bin/origin.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/origin-5c775a8d016ab106.d: src/bin/origin.rs
src/bin/origin.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-b33cede9d22ae3ee: src/bin/proxy.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-b33cede9d22ae3ee.d: src/bin/proxy.rs
src/bin/proxy.rs:

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.proxy-b33cede9d22ae3ee</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-e2b40a5fbef4cfc6.rmeta: src/bin/proxy.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-e2b40a5fbef4cfc6.d: src/bin/proxy.rs
src/bin/proxy.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-f38f9f2c2cdd137a.rmeta: src/bin/proxy.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/proxy-f38f9f2c2cdd137a.d: src/bin/proxy.rs
src/bin/proxy.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/tcpproxy-bc5b79807d74c314.rmeta: src/main.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/tcpproxy-bc5b79807d74c314.d: src/main.rs
src/main.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/tcpproxy-f6c45a41f08d6bd4.rmeta: src/main.rs
/Users/prabhueshwarla/rust/author/packt/prod/chapter11/tcpproxy/target/debug/deps/tcpproxy-f6c45a41f08d6bd4.d: src/main.rs
src/main.rs:

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save