I've been struggling to connect my devcontainer with my local machine running Playwriter CDP relay server.
I'm running playwriter serve with the default host (0.0.0.0) and with a token.
I have my devcontainer (running on a different server) and my local machine on the same Tailscale tailnet, so I set the PLAYWRITER_HOST var with my local machine's tailnet address as well as the PLAYWRITER_TOKEN.
New Playwriter sessions can connect to my local machine but fail to detect the connected browser tabs. 'No connected browsers detected' is the error when running playwriter session new. And running playwriter browser list returns 'No browsers detected.'
Been going back and forth with Claude on this. Using some curl commands with the Auth header added we were able to confirm that "The relay can see your browser and the tab. The /json endpoint returns the page. The issue is how playwriter session new queries for browsers." But 'session new' fails to see the content.
The closest to an explanation I can get (right or wrong) is:
"The fetchExtensionsStatus call has no Authorization header either, which is why session new silently fails — it gets a 401 on /extensions/status, catches the error, and returns [] (no browsers).
This is a bug in the Playwriter CLI: when PLAYWRITER_TOKEN is set, it's not being passed to the /extensions/status or /cli/session/new endpoints for remote hosts. The token only gets added in the execute path."
I'm aware of the traforo tunnel example but would prefer to use my Tailscale setup.
Is there anything to this Auth header theory or is it a hallucination?
Thank you!
I've been struggling to connect my devcontainer with my local machine running Playwriter CDP relay server.
I'm running playwriter serve with the default host (0.0.0.0) and with a token.
I have my devcontainer (running on a different server) and my local machine on the same Tailscale tailnet, so I set the PLAYWRITER_HOST var with my local machine's tailnet address as well as the PLAYWRITER_TOKEN.
New Playwriter sessions can connect to my local machine but fail to detect the connected browser tabs. 'No connected browsers detected' is the error when running playwriter session new. And running playwriter browser list returns 'No browsers detected.'
Been going back and forth with Claude on this. Using some curl commands with the Auth header added we were able to confirm that "The relay can see your browser and the tab. The /json endpoint returns the page. The issue is how playwriter session new queries for browsers." But 'session new' fails to see the content.
The closest to an explanation I can get (right or wrong) is:
"The fetchExtensionsStatus call has no Authorization header either, which is why session new silently fails — it gets a 401 on /extensions/status, catches the error, and returns [] (no browsers).
This is a bug in the Playwriter CLI: when PLAYWRITER_TOKEN is set, it's not being passed to the /extensions/status or /cli/session/new endpoints for remote hosts. The token only gets added in the execute path."
I'm aware of the traforo tunnel example but would prefer to use my Tailscale setup.
Is there anything to this Auth header theory or is it a hallucination?
Thank you!