expose icon indicating copy to clipboard operation
expose copied to clipboard

Own expose server (docker-compose) not redirecting to local machine

Open waterdrop01 opened this issue 4 years ago • 3 comments

Hello there!

I stumbled upon expose when looking for custom subdomain with ngrok (which is now a premium/paying option).

I'm running the server in docker (using docker-compose). Here is the docker-compose.yml:

version: "3"

services:
  expose:
    image: beyondcodegmbh/expose-server:latest
    networks:
      - web
    ports:
      - 9191:9191
    environment:
      port: 9191
      domain: expose.mydomain.tld
      username: admin
      password: password
    restart: always
    volumes:
      - ./database/expose.db:/root/.expose

I allowed port 9191 on the same server doing ufw allow 9191.

Then I started my local application, that is also listening on port 9191 (could be another one).

Finally I ran client expose command: expose share 127.0.0.1:9191 --subdomain=subdomain

PROBLEM: When doing a curl POST request on 127.0.0.1:9191, I can see it on my local application logs. But when doing the same curl POST request on http://subdomain.expose.mydomain.tld:9191 -> NOTHING. The curl command is hanging indefinitely.

Any help would be much appreciated!

Note: The connection between local expose client and server is OK (can see the corresponding line in the server admin dashboard). But nothing in the client admin dashboard.

Note 2 : Here is my client ~/.expose.config.pjp:

    /*
    |--------------------------------------------------------------------------
    | Host
    |--------------------------------------------------------------------------
    |
    | The expose server to connect to. By default, expose is using the free
    | sharedwithexpose.com server, offered by Beyond Code. You will need a free
    | Beyond Code account in order to authenticate with the server.
    | Feel free to host your own server and change this value.
    |
    */
    'host' => 'expose.mydomain.tld',

    /*
    |--------------------------------------------------------------------------
    | Port
    |--------------------------------------------------------------------------
    |
    | The port that expose will try to connect to. If you want to bypass
    | firewalls and have proper SSL encrypted tunnels, make sure to use
    | port 443 and use a reverse proxy for Expose.
    |
    | The free default server is already running on port 443.
    |
    */
    'port' => 9191,

waterdrop01 avatar Sep 14 '20 10:09 waterdrop01

Can you share what did you get when you run just the command expose on the machine that you want to connect to your host?

I have the same problem with you, kinda. i use the command

 expose share http://127.0.0.1/myWebFolder --subdomain=dennis

and it work.

dennisong45 avatar Sep 14 '20 17:09 dennisong45

Thanks @dennisong45 for your help. I use the same command as you:

expose share http://127.0.0.1:9191 --subdomain=subdomain

When doing

curl -d '{"key1":"value1"}' -H "Content-Type: application/json" -X POST http://127.0.0.1:9191/callbacks/new-tx

the HTTP request is being correctly logged in my application (locally running). But when doing:

curl -d '{"key1":"value1"}' -H "Content-Type: application/json" -X POST http://subdomain.expose.mydomain.tld:9191/callbacks/new-tx

Nothing happen (it's hanging).

I believe the problem is on the server side receiving the request and not properly forwarding it. But the server is logging nothing, just:

$ docker-compose up
Recreating expose_expose_1 ... done
Attaching to expose_expose_1
expose_1  | Expose server running on port 9191.

@dennisong45 are you running expose using docker-compose on the server side? Would you mind sharing your docker-compose.yml as well as how you changed your firewall rules?

waterdrop01 avatar Sep 14 '20 18:09 waterdrop01

Hmm, i'm not using docker, sorry i can't help you with that. If you run the command on the terminal expose share http://127.0.0.1:9191 --subdomain=subdomain What does it say on the terminal? Does the server receive any request?

dennisong45 avatar Sep 14 '20 18:09 dennisong45

Closing this issue because it's old. Please feel free to open a new one if it's still relevant.

sschlein avatar Dec 21 '23 13:12 sschlein