IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.57k stars 480 forks source link

Playground client not accessible remotely #2973

Closed tdiesler closed 3 years ago

tdiesler commented 3 years ago

This issue came up while taking part in the pioneer program

On MacOS there seem to be numerous issues with compiling the English Auction contract. Instead of trying to resolve those, I moved to a Debial10 hosted on GCE. I got the contract compiled and the playground server/client started.

However, because this is a remote machine I cannot access the playground-client on: https://localhost:8009

Instead, I'd like the playground-client to bind to 0.0.0.0, so that I can use the remote IP.

CrossRef: https://github.com/input-output-hk/plutus-pioneer-program/issues/3

Diagnostic info:

tdiesler commented 3 years ago

Adding host: "0.0.0.0" in plutus/plutus-playground-client/webpack.config.js seems to work ...

    devServer: {
        contentBase: path.join(__dirname, "dist"),
        compress: true,
        host: "0.0.0.0",
        port: 8009,
        https: true,
        proxy: {
            "/api": {
                target: 'http://localhost:8080'
            }
        }
    },

Not sure if this can generally be done to go forward.

KevinHock commented 3 years ago

For security reasons, defaulting to 0000 seems not good

yangzai commented 3 years ago

I spent a long time tweaking my router and firewalls before realising it was a webpack issue: https://webpack.js.org/configuration/dev-server/#devserverhost

kk-hainq commented 3 years ago

One can also create an SSH tunnel between the local machine and the cloud instance with something like:

ssh -i xxx.pem -N -L 8009:localhost:8009 xxx@xx.xxx.xx.xxx

To access the client through https://localhost:8009 just fine.

tdiesler commented 3 years ago

I think we can close this