Friday, April 14, 2017

Monitoring HTTP requests and WebSockets in Netbeans

Leave a Comment

I am writing a HTTP and WebSocket client in Java to connect to any http server.

I wrote something similar in js before and was able to use the network tab of the developer tools in firefox and chrome to see what HTTP requests were sent and what Websocket messages were exchanged.

My question is: is there any tool or plugin for Netbeans to see these same requests and messages?

2 Answers

Answers 1

Netbeans comes with an HTTP Monitor which you can access via Window -> HTTP Monitor.

Netbeans HTTP Monitoring

Answers 2

If your intent is to observe / log / inspect outgoing and incoming connections from your tool, then you would need to intercept the traffic somehow.

Wireshark can help with that. If the transport is over SSL then Wireshark may not be much help.

You could use a reverse proxy like charles, intercept the traffic and inspect it there. https://www.charlesproxy.com/documentation/proxying/reverse-proxy/

Also, here is a similar question : Log all network interactions of Java application

Hope it helps. Also, not entirely sure why you would need a netbeans plugin? When your application is running, it will do so in its own JVM, so unless you are planning on packaging the plugin with your tool, I don't see how you can use it.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment