5

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?

Rik Schaaf
  • 1,101
  • 2
  • 11
  • 30

2 Answers2

2

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

Netbeans HTTP Monitoring

lax1089
  • 3,403
  • 3
  • 17
  • 37
0

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.

Community
  • 1
  • 1
jayaram S
  • 580
  • 6
  • 13
  • The reason I was looking for a plugin was because I knew that plugins exist for browsers and wanted to know if similar tools existed for the jvm or ide. Concerning SSL, I can do without until I verified in my test environment that the correct messages are sent. After that I do indeed plan on using SSL. How do you mean it will do so in the jvm? – Rik Schaaf Apr 12 '17 at 18:12
  • To my (limited) knowledge, there are no tools that exposes the network traffic from the JVM like those in browsers. When your program is running, it is doing so within the context of the JVM. So the only way to observe it would be to use tools like jvisualvm. visual vm does not monitor network traffic though. I use charles reverse proxy quite often to monitor on the wire HTTP(s) traffic, downside is you need to configure it as a proxy. Reason we I use it is its ability to deal with ssl traffic – jayaram S Apr 12 '17 at 18:32