Problems with Pixel Streaming over the Internet (config.json)

I’m kinda lost with an issue trying to pixel stream our app over the web from our local servers.

Following the documentation, I’ve achieved pixel streaming over the LAN (using either internal or public IP), but no luck when trying to do so over the open web. To solve this, I tried to set up a STUN and a TURN server, but when I try to include the IPs of the ICE servers in config.json, I get an “invalid JSON” error message.

I don’t know what could possibly be wrong with it, as I’m strictly following the documentation IMO. My config.json reads as follows:


{
    "UseFrontend": false,
    "UseMatchmaker": false,
    "UseHTTPS": false,
    "UseAuthentication": false,
    "LogToFile": true,
    "publicIp": "50.60.70.80"
    "peerConnectionOptions": "{\"iceServers\":{\"urls\":\"stun: 50.60.70.80:3478\",\"turn: 50.60.70.80:5349\"],\"username\":\"USER\",\"credential\":\"PASSWORD\"}]}"
    "HomepageFile": "player.htm",
    "AdditionalRoutes": {},
}

The problem seems to be with the “peerConnectionOptions”. The error message reads:


ERROR: Invalid JSON in .\config.json, ignoring file config, SyntaxError: Unexpected string in JSON at position 148

Am I missing something here?

I really need help with this. :frowning:
Is there some other place/forum better suited for my question?

{
UseFrontend: false,
UseMatchmaker: false,
UseHTTPS: false,
UseAuthentication: false,
LogToFile: true,
HomepageFile: ‘player.htm’,
AdditionalRoutes: new Map(),
publicIp: “99.99.99.99”,
peerConnectionOptions : {“iceServers”: {“urls”: “stun:99.99.99.99:3478”,“turn:99.99.99.99:3478”], “username”: “User”, “credential”: “Passwd”}] }
};

and modfity cirrus.js:

from:
if(typeof config.peerConnectionOptions != ‘undefined’){
clientConfig.peerConnectionOptions = JSON.parse(config.peerConnectionOptions);
console.log(peerConnectionOptions = ${JSON.stringify(clientConfig.peerConnectionOptions)}); }

to:
if(typeof config.peerConnectionOptions != ‘undefined’){
clientConfig.peerConnectionOptions = config.peerConnectionOptions;
console.log(peerConnectionOptions = ${JSON.stringify(clientConfig.peerConnectionOptions)}); }

Thanks for posting. I did the suggested changes to config.json and to cirrus.js. However, I still get the following error message (posting full log):


npm WARN cirrus-webserver@0.0.1 No repository field.
npm WARN cirrus-webserver@0.0.1 No license field.

audited 391 packages in 1.376s
found 2 vulnerabilities (1 low, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
**22:11:12.614 ERROR: Invalid JSON in .\config.json, ignoring file config, SyntaxError: Unexpected token U in JSON at position 2**
22:11:12.621 Config: {
        "UseFrontend": false,
        "UseMatchmaker": false,
        "UseHTTPS": false,
        "UseAuthentication": false,
        "LogToFile": true,
        "HomepageFile": "player.htm",
        "AdditionalRoutes": {}
}
(node:6968) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
22:11:12.735 Listening to proxy connections on: 8888
22:11:12.735 Http listening on *: 80

What I don’t get: How can there be a SYNTAX ERROR? I don’t know anything about JSON, but I just copy/paste content from either the documentation or from user help… yet, it prints a Syntax Error?