UWUplus / flask-cloudflared

Run a TryCloudflare tunnel to your flask app right from code.
Other
35 stars 16 forks source link

Port not being set properly when using app. run(port=1337, metrics_port=1338) (both for me and on the provided colab) #13

Open opencoca opened 1 year ago

opencoca commented 1 year ago

I'm currently experiencing an issue when trying to set the port for my Flask application using the app.run(port=1337, metrics_port=1338) arguments as suggested in the example provided in the repository (https://github.com/UWUplus/flask-cloudflared/blob/main/examples/flask_cloudflared_example.py).

The metrics_port argument gets set properly, but the main application still insists on running on port 5000, ignoring the specified port argument.

Steps to reproduce:

  1. Set up the Flask application per the README instructions.
  2. Include the following in the main function:

    if __name__ == '__main__':
        app.run(port=1337, metrics_port=1338)

Expected behaviour:

The Flask application should operate on port 1337, and the metrics server should function on port 1338.

Actual behaviour:

The metrics server runs on port 1338 as expected, but the main Flask application runs on port 5000, ignoring the specified port argument.

shhossain commented 1 year ago

I've added a pr request for this problem. #14

UWUplus commented 1 year ago

Hi @shhossain, thanks for the PR I'll look into it ASAP.

UWUplus commented 1 year ago

Just wanted to check in, I currently can't get either version running on my apple silicon. cloudflared in general isn't working - will fix that and look into the PR again. Looks good in the first place.

shhossain commented 1 year ago

@UWUplus oka

UWUplus commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

shhossain commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

what do you mean by "SIGINT" ?

UWUplus commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

what do you mean by "SIGINT" ?

CTRL + C

shhossain commented 1 year ago

@UWUplus let me check

shhossain commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

what do you mean by "SIGINT" ?

CTRL + C

@UWUplus no problem exiting the program.

UWUplus commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

what do you mean by "SIGINT" ?

CTRL + C

@UWUplus no problem exiting the program.

Also working when restarting?

shhossain commented 1 year ago

Hi @shhossain, just checked this again, cloudflared wasn't exiting when I tried your pr, that's why I couldn't get main running. Does running the example for a second time after a SIGINT work for you?

what do you mean by "SIGINT" ?

CTRL + C

@UWUplus no problem exiting the program.

Also working when restarting?

Yes.