Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15531 closed enhancement (fixed)

Option to see the traffic between JOSM and OSM servers

Reported by: naoliv Owned by: naoliv
Priority: normal Milestone: 17.11
Component: Core Version:
Keywords: Cc:

Description

Could we have a way to see the payload that JOSM sends to OSM servers, please?

Even with --debug it's not possible to see what JOSM sends.
For example:

2017-11-08 11:08:34.917 INFO: POST http://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload (529 B) ...
2017-11-08 11:08:35.156 FINE: Uploading data ...
2017-11-08 11:08:35.396 INFO: POST http://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload -> 301 (380 B)
(...)

JOSM:

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2017-11-07 00:03:11 +0100 (Tue, 07 Nov 2017)
Revision:13096
Build-Date:2017-11-07 02:33:06
URL:http://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (13096 en) Linux Debian GNU/Linux testing (buster)
Memory Usage: 624 MB / 7168 MB (496 MB allocated, but free)
Java version: 9.0.1+11-Debian-1, Oracle Corporation, OpenJDK 64-Bit Server VM
Screen: :0.0 1600x900, :0.1 1280x1024
Maximum Screen Size: 1600x1024
Java package: openjdk-9-jre:amd64-9.0.1+11-1
Java ATK Wrapper package: libatk-wrapper-java:all-0.33.3-13
VM arguments: [-Djosm.home=<josm.pref>, -Dawt.useSystemAAFontSettings=on]
Program arguments: [--debug, --language=en]
Dataset consistency test: No problems found

Attachments (0)

Change History (10)

comment:1 by stoecker, 7 years ago

Owner: changed from team to naoliv
Status: newneedinfo

Why?

comment:2 by naoliv, 7 years ago

Of course this would add nothing for JOSM users in general, but I would like to see and learn, from a nice program, how exactly the API works :-)

comment:3 by Don-vip, 7 years ago

Have you tried with --trace?

in reply to:  3 comment:4 by naoliv, 7 years ago

Replying to Don-vip:

Have you tried with --trace?

While it gets extremely verbose, it still doesn't display what it sends/receives.

comment:5 by stoecker, 7 years ago

Resolution: wontfix
Status: needinfoclosed

Either use wireshark or tcpdump

tcpdump -a host master.apis.dev.openstreetmap.org

As long as you use HTTP there are easier ways to snip TCP transmission.

in reply to:  5 comment:6 by bastiK, 7 years ago

Replying to stoecker:

Either use wireshark or tcpdump

tcpdump -a host master.apis.dev.openstreetmap.org

As long as you use HTTP there are easier ways to snip TCP transmission.

Does that work? Last time I tried, there were automatic redirects to https in place.

I also need this feature from time to time and usually just add a println in OsmApi.sendRequest.

comment:7 by naoliv, 7 years ago

It redirects to HTTPS. See #15532
It should be possible to capture on the first POST to HTTP (before the redirect)

From the same example from the other ticket:

2017-11-08 11:08:34.917 INFO: POST http://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload (529 B) ...
2017-11-08 11:08:35.156 FINE: Uploading data ...
2017-11-08 11:08:35.396 INFO: POST http://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload -> 301 (380 B)
2017-11-08 11:08:35.397 FINE: RESPONSE: {null=[HTTP/1.1 301 Moved Permanently], Server=[Apache/2.4.18 (Ubuntu)], Connection=[close], Content-Length=[380], Date=[Wed, 08 Nov 2017 13:08:36 GMT], Content-Type=[text/html; charset=iso-8859-1], Location=[https://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload]}
2017-11-08 11:08:35.397 INFO: Download redirected to 'https://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload'
2017-11-08 11:08:35.398 FINE: Contacting Server...
2017-11-08 11:08:35.398 FINE: null
2017-11-08 11:08:35.399 INFO: POST https://master.apis.dev.openstreetmap.org/api/0.6/changeset/108073/upload (529 B) ...
2017-11-08 11:08:35.886 FINE: Uploading data ...

comment:8 by stoecker, 7 years ago

With https it is a bit more complicated. You need to use one of the many local proxies. Either one for directly data analysis or only to have the connection to the proxy with http. Google said "Fiddler" as one of the first keywords.

comment:9 by Don-vip, 7 years ago

Resolution: wontfixfixed

In 13099/josm:

fix #15531 - trace request body for HTTP POST, PUT and DELETE

comment:10 by Don-vip, 7 years ago

Milestone: 17.11

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain naoliv.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.