Modify

Opened 11 days ago

Closed 11 days ago

Last modified 11 days 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 Changed 11 days ago by stoecker

Owner: changed from team to naoliv
Status: newneedinfo

Why?

comment:2 Changed 11 days ago by naoliv

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 Changed 11 days ago by Don-vip

Have you tried with --trace?

comment:4 in reply to:  3 Changed 11 days ago by naoliv

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 Changed 11 days ago by stoecker

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.

comment:6 in reply to:  5 Changed 11 days ago by bastiK

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 Changed 11 days ago by naoliv

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 Changed 11 days ago by stoecker

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 Changed 11 days ago by Don-vip

Resolution: wontfixfixed

In 13099/josm:

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

comment:10 Changed 11 days ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.