From ea2b5fcca1106cc6bd418ec54efd741ba823e096 Mon Sep 17 00:00:00 2001 From: einisto <79069176+einisto@users.noreply.github.com> Date: Fri, 12 Aug 2022 00:44:07 +0300 Subject: [PATCH] Correct address binding --- .github/workflows/release.yml | 33 --------------------------------- README.md | 4 ++-- src/server.rs | 6 ++++-- 3 files changed, 6 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 56f4a37..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Compile & Release - -on: - release: - tags: - - "*" - -env: - CARGO_TERM_COLOR: always - -jobs: - release: - name: Release ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - fail-fast: false # Don't fail all jobs even if one fails - matrix: - include: - - target: x86_64-unknown-linux-musl - archive: tar.gz tar.xz - - target: x86_64-apple-darwin - archive: zip - - steps: - - uses: actions/checkout@main - - name: Compile and release - uses: rust-build/rust-build.action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - RUSTTARGET: ${{ matrix.target }} - ARCHIVE_TYPES: ${{ matrix.archive }} - EXTRA_FILES: "README.md LICENSE" diff --git a/README.md b/README.md index ccaaee8..3537cec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## TCP socket pair for easy and efficient file transfer -Single binary containing both server and client. Originally made as an backend for [other project](https://github.com/einisto/leightbox). +Single binary containing both server and client. Originally made as a backend for [a TUI app](https://github.com/einisto/leightbox). Note that the server can't be hosted on a mobile hotspot network due to firewalling of most cellular networks. Despite this the client side can still obviously be used even on those scenarios.

@@ -23,7 +23,7 @@ cargo build --release ./target/release/fragilebyte ``` -If no options are specified the app starts as a server by default. It can be started as a client by defining a target address with the commands shown below. +If no options are specified the app starts as a server by default. It can be started as a client by defining a target address: ``` USAGE: diff --git a/src/server.rs b/src/server.rs index 3abdfa3..01f0bd2 100644 --- a/src/server.rs +++ b/src/server.rs @@ -30,7 +30,10 @@ pub async fn listen( ) -> Result<(), Box> { let addr = match localhost { true => SocketAddr::new(IpAddr::from_str("127.0.0.1")?, port), - false => SocketAddr::new(local_ip()?, port), + false => { + println!("[+] Listening on {}:{}", local_ip()?, port); + SocketAddr::new(IpAddr::from_str("0.0.0.0")?, port) + } }; // Use weak access key for integration testing, otherwise 8 char alphanumeric let access_key = match use_testing_key { @@ -39,7 +42,6 @@ pub async fn listen( }; let listener = TcpListener::bind(addr).await?; - println!("[+] Listening on {}", addr); println!("[+] Access key: {}", access_key); loop {