Record and Playback not working?

847 views
Skip to first unread message

Zaid Ibrahim

unread,
Sep 8, 2015, 7:47:32 PM9/8/15
to wiremock-user
Hey all,

I'm following the instructions laid out here: http://wiremock.org/record-playback.html, with little success. Whenever I hit my proxy in chrome (type in localhost:8080 in the url bar), I simply get re-directed back to the website which I'm trying to record. 

Here is the command I'm trying to run, straight from my terminal:

java -jar wiremock-1.57-standalone.jar --proxy-all="http://www.cnn.com" --record-mappings


Can anyone tell me what's going on? 

Tom Akehurst

unread,
Sep 9, 2015, 3:23:54 AM9/9/15
to wiremock-user
Maybe CNN are sending a 302 redirect back with an absolute URL? If so your browser will redirect to whatever is in the location header.

Zaid Ibrahim

unread,
Sep 9, 2015, 5:32:35 PM9/9/15
to wiremock-user
Alright, so I kinda figured out what was going on. The reason I was sometimes getting redirected was because the site (CNN, etc...) was using https authentication, and determined that I must have been doing a man in the middle attach since I was proxying requests to CNN through my wire mock server.

So, I'm trying now to set up my wire mock server to allow reverse proxying, such that I can access these https sites through wire mock, but I have another problem...

This is the command I'm running now:

java -jar wiremock-1.57-standalone.jar 

--proxy-all="https://www.reddit.com

--record-mappings 

--https-port=8443 

--https-truststore="/Users/userName/.jks/privateKey.store" 

--truststore-password="passpass"

--https-require-client-cert=true


But I get this response back from the CLI:


Exception in thread "main" 

Exception: java.util.MissingResourceException thrown from the UncaughtExceptionHandler in thread "main"


I'm not sure what's going on here. I'm trying to set up a reverse proxy by following instructions here, but maybe I'm doing something wrong? Thanks very much for any help you can offer.


Zaid Ibrahim

unread,
Sep 9, 2015, 6:33:15 PM9/9/15
to wiremock-user
Alright, so I was able to get past that last error by just running this:

java -jar wiremock-1.57-standalone.jar --proxy-all="https://www.reddit.com" --record-mappings --https-port=8443


I don't know why I got an error when specifying where my trust store was, but at least I was able to get past that. Now I find that there is an issue where absolute URLs bypass wiremock entirely, despite the proxy-all parameter I have in the command I'm running. 

For instance, a link to the absolute url ("https://www.reddit.com/bar/baz") will make my browser traverse to that link. However, a link to a relative url ("/bar/baz") will correctly make by browser go to localhost:8443/bar/baz, which is my intended behavior.

Thanks very much for anything you can help with. :)

Zaid Ibrahim

unread,
Sep 9, 2015, 7:47:12 PM9/9/15
to wiremock-user
I guess it would be best if I took a step back, and asked if what I want to do is possible.

I want to use wire mock in a way that would enable someone to turn on wire mock for a website containing form data (which may, or may not be behind https), complete that form in some way, and have wire mock record the pages the user visited, and be able to replay those links back when prompted. The user would be browsing these links via some browser. It sounds like what I want is possible in theory, but I keep getting hung up on things like absolute urls, etc...

Michael Tecourt

unread,
Jan 13, 2016, 2:15:35 PM1/13/16
to wiremock-user
The exception described here :
Exception: java.util.

MissingResourceException thrown from the UncaughtExceptionHandler in thread "main"


Seems to be thrown whenever wiremock-standalone jar receives a parameter it cannot interpret.

Checkout the parameters here, some seem to have a standard posix format (parameter value) and others (parameter=value).

For me it was just a matter of a shell script adding some random parameter that I didn't see from the outside.

Reply all
Reply to author
Forward
0 new messages