dev-tunnels icon indicating copy to clipboard operation
dev-tunnels copied to clipboard

How to inspect traffic for a running tunnel?

Open andrewconnell opened this issue 2 years ago • 7 comments

This tool is positioned as a replacement for ngrok. One very useful feature of ngrok is the ability to view the request/response on a currently running tunnel.

I can't figure out how to do this with this tool, either through the browser (like ngrok) or via the CLI.

I can see an active tunnel...

devtunnel show <tunnel-id>

But when I connect to it, it just outputs a stream of "opened" ports and never shows any data on them...

devtunnel connect <tunnel-id>

Is it possible to get a debug view of the traffic without using another tool?

andrewconnell avatar Oct 04 '23 14:10 andrewconnell

Hi @andrewconnell, thanks for reaching out to us! If you run the host command, you should see the inspection URL in the output. Here's an example inspection URL: https:/<tunnel_id>-8080-inspect.usw2.devtunnels.ms/. Let me know if that works for you!

curib avatar Oct 04 '23 17:10 curib

@curib Cool... not sure why that didn't occur to me... thanks... got it working now.

However, when see the traffic show up on the inspection page, I only see requests. I don't see the response side of the payload. Every entry's payload is empty. Is it possible to see the payload?

With ngrok, you can see the both sides of the request, so I'm seeing about half that. Am I missing something?

andrewconnell avatar Oct 04 '23 17:10 andrewconnell

Hi @andrewconnell, yes you should be able to see the request and response payload through inspection. Can I get the tunnelId you were using when the responses weren't showing up with inspection so I can take a look. Also, what application type were you testing when sending requests through the tunnel?

jfullerton44 avatar Oct 05 '23 17:10 jfullerton44

Sure... the ID was: d3nqz99s.use2

So far, I've never seen the responses come through (admittedly I've only used this about 10-15 times in the last 24h (since @curib replied).

These are all requests kicked off using the Teams Toolkit extension for VSCode & used for bots (so traffic is init'd from the Azure Bot Framework).

andrewconnell avatar Oct 05 '23 17:10 andrewconnell

@andrewconnell Can you see if this issue still exists, and if so, can you send the tunnel id that it is happening on if it is different. We have added additional logging that should help diagnose the issue.

jfullerton44 avatar Oct 18 '23 18:10 jfullerton44

@jfullerton44 I'm not sure what changed on my side or with the service, but it's been working for the last week. Sorry for not following up. I'll go ahead and close this issue since it's not an open issue for me.

andrewconnell avatar Oct 19 '23 14:10 andrewconnell

@jfullerton44 scratch that... it seems like it's inconsistent. Here's one where I'm not seeing a response: ttcbst87.use

These screenshots show I'm getting the request, it's responding with an HTTP 200, & the host app is behaving like it's getting the expected response, but the inspector isn't showing any response.

Screenshot 2023-10-20 at 6 43 22 AM Screenshot 2023-10-20 at 6 43 43 AM Screenshot 2023-10-20 at 6 43 59 AM

andrewconnell avatar Oct 20 '23 10:10 andrewconnell

We’ve made improvements in this area since this issue was filed. We believe this may have improved your experience and are closing this issue. Thank you.

derekbekoe avatar Aug 05 '24 22:08 derekbekoe