<p>Not sure if answering my own question is some sort of faux pas, but, figure I will put it in here because I have been banging my head on this one for hours and the fix appears to be very simple.</p>
<p>edit Plutus-apps/plutus-playground-client/webpack.config.js,adding a 'host' param as well as turning off HTTPS (its local dev, https isn't critical here):</p>
<pre><code>devServer: {
    contentBase: path.join(__dirname, &quot;dist&quot;),
    compress: true,
    port: 8009,
    host: '0.0.0.0',&lt;-- Add this
    https: false, &lt;-- Change this from 'true' to 'false'
    stats: &quot;errors-warnings&quot;,
    proxy: {
        &quot;/api&quot;: {
            target: &quot;http://127.0.0.1:8080&quot;,
        },
    },
},
</code></pre>
<p>Additionally, I need to specifically build the Plutus-playground-client:</p>
<pre><code>cd plutus-apps
nix-build -A plutus-playground.client
nix-shell
cd plutus-apps/plutus-playground-client
npm run start
</code></pre>

CC BY-SA 4.0
2022-01-13T02:20:34.910Z
2022-01-15T03:52:38.147Z
2022-01-15T03:52:38.147Z
prodineeritecht
<p>I am on an Intel based iMac Pro running Big Sur (11.6.1)
I have followed every variant of the local playground setup I can find (all are some version of page 2 in this document <a href="https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#heading=h.orxckbtlhnnq" rel="nofollow noreferrer">https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#heading=h.orxckbtlhnnq</a>) and while I can get both the playground client and server to start, and I can load up the playground client web page in my browser, I can't &quot;compile&quot; the code in the playground because of the web page receives 504 connection errors.  So, here is what the playground web page looks like:</p>
<p><a href="https://i.sstatic.net/U4jXG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/U4jXG.png" alt="Screenshot of the playground running locally" /></a></p>
<p>And I see these errors in the Plutus-playground-client console when I do anything in the UI:</p>
<pre><code>[HPM] Error occurred while trying to proxy request /api/oauth/status from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
</code></pre>
<p>[HPM] Error occurred while trying to proxy request /api/contract from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (<a href="https://nodejs.org/api/errors.html#errors_common_system_errors" rel="nofollow noreferrer">https://nodejs.org/api/errors.html#errors_common_system_errors</a>)</p>
<p>Interestingly enough, if I copy the &quot;compile&quot; request from the chrome inspector as a curl command and adjust the URL to be the playground-server port, The connection to the playground-server is successful and the code compiles, so something seems broken with the client.</p>
<p>Also, using lsof, I have verified that both the server and client are listening on the correct ports.</p>

<plutus-pioneer-program>
Playground client can't connect to playground server (all localhost)
# Playground client can't connect to playground server (all localhost)

(Asked by: username_0 on 2022-01-13)

I am on an Intel based iMac Pro running Big Sur (11.6.1)
I have followed every variant of the local playground setup I can find (all are some version of page 2 in this document https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#heading=h.orxckbtlhnnq) and while I can get both the playground client and server to start, and I can load up the playground client web page in my browser, I can't "compile" the code in the playground because of the web page receives 504 connection errors.  So, here is what the playground web page looks like:

And I see these errors in the Plutus-playground-client console when I do anything in the UI:
[HPM] Error occurred while trying to proxy request /api/oauth/status from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

[HPM] Error occurred while trying to proxy request /api/contract from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Interestingly enough, if I copy the "compile" request from the chrome inspector as a curl command and adjust the URL to be the playground-server port, The connection to the playground-server is successful and the code compiles, so something seems broken with the client.
Also, using lsof, I have verified that both the server and client are listening on the correct ports.

**Tags:** plutus-pioneer-program

---

## 1 answers

### Answer by username_0 on 2022-01-13. Score: 0

Not sure if answering my own question is some sort of faux pas, but, figure I will put it in here because I have been banging my head on this one for hours and the fix appears to be very simple.
edit Plutus-apps/plutus-playground-client/webpack.config.js,adding a 'host' param as well as turning off HTTPS (its local dev, https isn't critical here):
devServer: {
    contentBase: path.join(__dirname, "dist"),
    compress: true,
    port: 8009,
    host: '0.0.0.0',<-- Add this
    https: false, <-- Change this from 'true' to 'false'
    stats: "errors-warnings",
    proxy: {
        "/api": {
            target: "http://127.0.0.1:8080",
        },
    },
},

Additionally, I need to specifically build the Plutus-playground-client:
cd plutus-apps
nix-build -A plutus-playground.client
nix-shell
cd plutus-apps/plutus-playground-client
npm run start


---

