Skip to content
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

Transmissionic fails when behind a proxy without specifying a port #1373

Open
taylorcox75 opened this issue Jul 21, 2023 · 1 comment
Open

Comments

@taylorcox75
Copy link

taylorcox75 commented Jul 21, 2023

Describe the bug
A large chunk of people, myself included use NGINX as a reverse proxy to access transmission-daemon via a subdomain / without a port behind. Meaning it's behind a proxy with no open ports to the internet. i.e. torrent.mydomain.com or mydomain.com/torrent.

Transmissionic does not work without a port as the : is hard coded regardless of if the user gives one. So if I leave that field blank, the url it parses is torrent.mydomain:9091/transmission/rpc/ or mydomain.com/torrent:9091/transmission/rpc/

To Reproduce

  1. Add a server.
  2. Even with the port field empty, it appends :9091.

Visually,:
alt text

Platform:

  • Reproduced on iOS and Windows 11

Cause:

getRequestUrl(): string {
    let result = this.options.https ? "https":"http";
    result += "://"+this.options.host+":"+this.options.port+this.options.path; <----- Note the `+":"+`
    return result;
  }

So the URL will always have :port in it.

Fix:
Add conditional logic in 2 places.

  1. The getRequestUrl function
  2. The loop that parses the user's input and maps it to an array.

If we only did step 1, the empty port field would be overwritten here:

 this.options = {
      host:'localhost',
      path:'/transmission/rpc',
      port:9091, <-----------------------
      port:'',
      https:false,
      timeout:timeout
    };
  1. There is no need to use a v-model-number. As we treat this field as a string everywhere, v-model equally works. There was some random edge case where a blank value wouldn't be accepted (i.e. what happens if the user enters then deletes the number value, replacing it with an empty string).
    <ion-input v-model.number="newConf.port" type="number" placeholder="9091"></ion-input>

I have already made these changes for a local build of this app, and have created a pull request if this was something you wanted patched here too.

taylorcox75 added a commit to taylorcox75/Transmissionic that referenced this issue Jul 21, 2023
@taylorcox75
Copy link
Author

#1374

@taylorcox75 taylorcox75 changed the title Transmissionic when behind a proxy without specifying a port Transmissionic fails when behind a proxy without specifying a port Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant