Giter Club home page Giter Club logo

Comments (5)

Power2All avatar Power2All commented on May 31, 2024

Easy, you can use the following 4 blocks for binding the server to it.
The IPv4 and IPv6 addressses shown below are examples.
Change them to the IP addresses you want them to bind, they both are set for SSL and/or without SSL (port 443 and port 80). Technically, you only need to use IPv4 set, and if you use CloudFlare, use their IPv4/IPv6 proxy, which the tracker software can recognize.

[[http_server]]
enabled = false
bind_address = "1.2.3.4:80"
threads = 2
ssl = false
ssl_key = ""
ssl_cert = ""

[[http_server]]
enabled = false
bind_address = "1.2.3.4:443"
threads = 2
ssl = true
ssl_key = "key.pem"
ssl_cert = "cert.pem"

[[http_server]]
enabled = true
bind_address = "[6313:4660:2a72:3448:3533:31da:b76d:c3b0]:80"
threads = 2
ssl = false
ssl_key = ""
ssl_cert = ""

[[http_server]]
enabled = true
bind_address = "[6313:4660:2a72:3448:3533:31da:b76d:c3b0]:443"
threads = 2
ssl = true
ssl_key = "key.pem"
ssl_cert = "cert.pem"

from torrust-actix.

ryjer avatar ryjer commented on May 31, 2024

With those configures

[[http_server]]
enabled = true 
bind_address = "0.0.0.0:6969"
ssl = false
ssl_key = ""
ssl_cert = ""

[[http_server]]
enabled = true
bind_address = "[::]:6969"
ssl = false
ssl_key = ""
ssl_cert = ""

It prints those error logs

2023-10-02 19:54:53.599576697 [INFO ][torrust_actix::logging] logging initialized.
2023-10-02 19:54:53.599782127 [INFO ][torrust_actix] torrust-actix - Version: 3.2.1
2023-10-02 19:54:53.606081704 [INFO ][torrust_actix::http_api] [API] Starting server listener on 0.0.0.0:8080
2023-10-02 19:54:53.606639868 [INFO ][actix_server::builder] starting 4 workers
2023-10-02 19:54:53.606698426 [INFO ][torrust_actix::http_service] [SERVICE] Starting server listener on 0.0.0.0:6969
2023-10-02 19:54:53.607050115 [INFO ][actix_server::builder] starting 4 workers
2023-10-02 19:54:53.607093423 [INFO ][torrust_actix::http_service] [SERVICE] Starting server listener on [::]:6969
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', /home/ryjer/tmp/torrust-actix-3.2.1/src/http_service.rs:61:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems not supports bind the seem port to both ipv4 and ipv6 address

from torrust-actix.

Power2All avatar Power2All commented on May 31, 2024

With those configures

[[http_server]]
enabled = true 
bind_address = "0.0.0.0:6969"
ssl = false
ssl_key = ""
ssl_cert = ""

[[http_server]]
enabled = true
bind_address = "[::]:6969"
ssl = false
ssl_key = ""
ssl_cert = ""

It prints those error logs

2023-10-02 19:54:53.599576697 [INFO ][torrust_actix::logging] logging initialized.
2023-10-02 19:54:53.599782127 [INFO ][torrust_actix] torrust-actix - Version: 3.2.1
2023-10-02 19:54:53.606081704 [INFO ][torrust_actix::http_api] [API] Starting server listener on 0.0.0.0:8080
2023-10-02 19:54:53.606639868 [INFO ][actix_server::builder] starting 4 workers
2023-10-02 19:54:53.606698426 [INFO ][torrust_actix::http_service] [SERVICE] Starting server listener on 0.0.0.0:6969
2023-10-02 19:54:53.607050115 [INFO ][actix_server::builder] starting 4 workers
2023-10-02 19:54:53.607093423 [INFO ][torrust_actix::http_service] [SERVICE] Starting server listener on [::]:6969
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 98, kind: AddrInUse, message: "Address already in use" }', /home/ryjer/tmp/torrust-actix-3.2.1/src/http_service.rs:61:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems not supports bind the seem port to both ipv4 and ipv6 address

If you want to bind on any network interface, you only need [::]:6969 as this will bind on both IPv4 and IPv6. Hence the "already listening" error you see.

from torrust-actix.

ryjer avatar ryjer commented on May 31, 2024

Although the tcp4 and udp4 information in log and /api/stats is 0 with the configure [::]:6969, it does works at ipv4 qbittorrent client.

Thanks for your help.

from torrust-actix.

Power2All avatar Power2All commented on May 31, 2024

Although the tcp4 and udp4 information in log and /api/stats is 0 with the configure [::]:6969, it does works at ipv4 qbittorrent client.

Thanks for your help.

Correct, it's a iffy thing, that's why you should just use the IP's your interface uses, instead of [::] or 0.0.0.0. This way you have much more control how your application is listening and binding.

from torrust-actix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.