Content Security Policy(“script-src”) - Websocket connection - Firefox extension

Hello everybody i’m trying to connect my new Firefox extension to a localhost websocket.
i’m using this javascript code in my extension:
const socket = new WebSocket(‘ws://localhost:61234’);
And in the html file, where is the extension design interface, i have insert this code
<meta http-equiv=“Content-Security-Policy” content=“default-src ‘self’ ws: localhost ‘unsafe-inline’;”>
But it doesn’t work too.

What can i do to solve this situation?

I’m using Python for the localhost server
client, addr = sock.accept()
command = client.recv(1024) # Waiting…
command_decoded = command.decode(“utf-8”)

Is this in content, or in an extension page?

Error messages for content might appear in the regular Web Console.

Error messages for extension pages can be viewed in the about:debugging Inspector => Console, although you might need to change windows using the little button on the right side that looks like a window with 3 frames.

I tried a lot solution found on the web but nothing had works, i solved using NodeJS and not more Python.