woltapp / mitmproxy-mock Goto Github PK
View Code? Open in Web Editor NEWA tool to mock/modify server responses easily with mitmproxy
License: MIT License
A tool to mock/modify server responses easily with mitmproxy
License: MIT License
Firstly , I would like to thank you to produce this very great and easy to use work for community.
I have a quick question regarding mock configuration
background:
currently we're using mitmproxy-mock in our test scenario and we have multiple cases which need to be mock differently
my aim is to separate the mock config to be multiple files per test cases so, that the maintainer can easily find the right place when there is the changes need to be done.
question:
as i check , right now it is support only 1 single file to be mock config, Is it possible to support multiple file in same folder ?
Best,
Oz
I use the below config to modify a request path. Is it possible to use a regex in the modify
block to get the digits from the middle of the url and move them to the end? Can't really find an answer in the docs. I'm guessing some variant of replace
?
"~^/api/foo/\\d+/bar": {
"modify":{
"path": "/api/foo/bar/14"
}
}
Can i ask to reverse me to israel [email protected].
Have some prob with ubuntu linux security.
I was tried to write project on jquery and javascript ... but some how my iptable with ipsec/ikev2 was unlocked.
The mocked request fails if the target host does not exist.
According to the doc
A request handler is triggered when the client makes a request. This occurs before anything is sent to the server
In practice it seems the host gets somehow resolved
In case of a match the request returns with value regardless the host.
Error message
502 Bad Gateway
ProtocolException('Server connection to (\'nodomain123.com\', 443) failed: Error connecting to "nodomain123.com": [Errno 111] Connection refused')
Use the following config.
mitmproxy -s moxy.py --set mock=config/example.json
{
"request": {
"/part1/part2/part3": {
"respond": {
"content": {
"foo": 15,
"bar": "M5",
}
}
}
}
}
export https_proxy="http://127.0.0.1:8080"
curl https://nodomain123.com/part1/part2/part3 # fails
curl https://google.com/part1/part2/part3 # works
I doubt everyone will read this and I don't know if this belongs here, but I need a bit of an advice and I'm having quite a hard time figuring this out as JS seems a bit painful to me. Say, we send a typical GET request to an URL, like https://www.example.com/ with some string (doesn't matter what it is) and we receive the respond from the real server: "example string". How could I use mitmproxy-mock to now "catch" this certain HTTP response and, say, change the said string to a different string, like "oh that's my own!" ?
@arkku
@0neel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.