Show network traffic - visual-studio-code

Is it possible to view the network traffic (http requests, raw http etc.) similar to chrome dev tools (network tab) generated by an application (nodejs if it makes any difference) via vscode?
This functionality is already present, but it doesn't show the requests and responses of the application running.

The developer tools are connected to the running instance of Code and not the application you are executing. Currently it is not possible to view network traffic for the application you are launching from Code.

You can try to start from mbehr1.vsc-webshark plugin and use WireShark tools for catching your app network i/o.
It would be great a more detailed post about configuring launching Rust app (server) in debug mode, wireshark with VSCode integrated UI, and maybe internal browser in a single launch.json action, but I can't point anything close to it.

Related

WebAPK creation failures on Android over VPN

My corporate VPN blocks all external traffic from an Android device. I am trying to test PWA that is internally hosted (all resources inside a firewall). What I observe is that despite passing Lighthouse audit my PWA fails the WebAPK creation process on a device. Specifically, the install process takes a long time, and eventually it degrades to an application shortcut install.
What I did:
Built the simplest PWA that I could think of (index.html registering service worker + sw.js with fetch even handling index.html request offline + web manifest) and hosted it on an internal server
Run Lighthouse audit on the desktop and made sure it passes all PWA Lighthouse audits
Run bubblewrap init on the manifest to double check that icons/names are OK
Tried to install PWA on an a Pixel phone from Chrome's dot dot dot menu behind firewall
After a long time, the application shortcut was installed (with Chrome overlay icon)
Checked chrome://webapks/ on my phone - no surprises here, I did not find WebAPK for my app
Turn on my corporate VPN workaround, which allows me to bypass VPN restrictions and access external addresses (rooted phone + ProxyDroid hackery)
Now WebAPK creation works
Question 1:
Could someone please explain what is involved in WebAPK creation that would make it fail behind a strict corporate firewall? Is there any external resource (a service perhaps?) involved here that I could advocate my corporate VPN to whitelist? If not, any advice of how to have automatic tests for WebAPK creation would be appreciated. I thought of using bubblewrap build, but, since it is for TWA's, I did not expected it to pass for my simple PWA.
Question 2:
In general, what is the best technique for diagnosing WebAPK creation failures for PWA's that pass Lighthouse audit?
The WebAPK is generated server-side by Chrome. Chrome sends details from the manifest, along with the icons to it's server, which then returns the WebAPK. As you pointed out, it's most likely your corporate firewall is blocking that request to the server, preventing Chrome from generating the WebAPK.
The code for generating WebAPKs in Chrome can be found here
For your second question, we don't really have good tools for debugging that, if Lighthouse passes, it should build the WebAPK (with the exception noted above). I suspect you could connect the device to your computer and use ADB to look at logs, but thats... ugly. Sorry.

How to capture xmpp traffic by tool

We are working on a project that uses Open fire(Xmpp) protocol. I have to capture that traffic(xmpp). suggest me tool and process.?
does wireshark work for xmpp traffic.?
Another suggestion only relevant if you happen to be using Smack:
If you are just trying to debug the traffic for a particular client while developing it and you happen to be using Smack as your client side library (just a guess since we are talking about openfire), then you can also make use of the Smack debug console. Adding the Java system property -Dsmack.debugEnabled=true will cause a debug console window to open each time an XMPP connection is established. IT shows traffic in/out and other useful information.
Yes, Wireshark works for XMPP traffic, as long as it is unencrypted.
If the connection is encrypted, you may be able to decrypt it by following the instructions at https://wiki.wireshark.org/SSL .
For monitors conversations and statistics of the openfire server,you can use Monitoring Service plugin in openfire.
For install
Go to server web amdin panel
Go to plugin menu
click on available plugin
find and install Monitoring Service plugin.

Console does not show event source from source map

In FireFox I load my web application which has a Source Map. The Source Map seems to be loaded correctly, as the Debugger tab shows the original source files.
However, the Console tab contains only links to the compiled code, instead of the Source Map code.
Is a Source mapping done in FireFox Console?
Do I have to enable anything?
Update: I also tried it in chrome and there the console shows the original location of the event, BUT: only the first time after starting chrome AND only, if I first load the page and then open the developer tools. Exactly same behaviour in opera (same engine...)
Update 2:
As of Firefox bug 670002 Web console does still not support source mapping.
In chrome the source mapping works more than once if I directly embed the source mapping instead of using an URL.
For chrome developer tools, the answer was covered in this issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=633549
In some cases, developer tools requested the source map file when no connection was alive anymore. It tried to open a new connection, which failed silently because of an invalid ssl certificate.
You may run into this, when:
You serve using https
You do not have a valid ssl certificate (which may happen often when you just run a quick local node.js https server)
Your https server closes the connection fast or immediately
Especially when your https server sends connection:close in the response headers you may run into this.
The biggest issue is, that this request is not shown in the network tap nor in the console, it is just silent.

How to monitor network requests of Chrome apps?

I’m interested in finding out exactly what network requests are made by certain 3rd party Chrome apps. I can open the Dev Tools from chrome://inspect/#apps, or from the context menu (enabled under chrome://flags/#debug-packed-apps), or by means of the Chrome Apps & Extensions Developer Tool. Whatever I do, the Network tab stays blank except an occasional image/png, while I’m sure lots of HTTP requests (or HTTPS to be exact) actually take place.
How can I monitor all network requests that an app makes? It seems easy for extensions, but not for standalone apps. Or is MITMing myself with a proxy with a self-signed certificate that Chrome is configured to trust the only option?

How to look at and describe the client and server communication between my browser and the Google server?

I need to be able to look at and describe the client and server communication between my browser and the Google server.
I have downloaded net-tools but can't specifically see the communication, I've tried Wireshark but this brings too many things into it.
How can I see the communication and describe it using some sort of a web debugger tool?
You can use the network tab in Chromes developer tools or in Firebug for Firefox to see all request that are sent to a server. You could also use Fiddler.
A Googler just did this for you:
https://plus.google.com/112218872649456413744/posts/dfydM2Cnepe
And a hacker news article:
https://news.ycombinator.com/item?id=5408597