Comments (5)
Thanks for your input. I guess I can support a simple version of isFileExist()
and readFile()
for you π
from proxyman.
Thanks for your input. I guess I can support a simple version of
isFileExist()
andreadFile()
for you π
I'm very much looking forward to your new version. I wonder if it will support using JSON parsing to read the contents of files. This way, I can compare file contents more conveniently and specifically.
async function onResponse(context, url, request, response) {
const filename = request.queries.page;
const path_to_local_file = "~/Desktop/" + filename + ".json"
if ("path_to_local_file not exists or path_to_local_file content is empty") {
writeToFile(response.body, path_to_local_file);
} else {
var local_file_json = JSON.parse(path_to_local_file's content)
if (local_file_json.some_value != response.body.some_value) {
// to update local file
writeToFile(response.body, path_to_local_file);
} else {
// no nothing or just print some log
}
}
return response;
}
from proxyman.
@andforce you can try this Beta build: https://download.proxyman.io/beta/Proxyman_5.3.0_New_file_common_func.dmg
- Add:
isFileExists()
- Add:
readFromFile()
- Snippet Code: https://docs.proxyman.io/scripting/snippet-code#read-a-file
async function onResponse(context, url, request, response) {
const textFilePath = "~/Desktop/myfile.json";
// check exist
if (isFileExists(filePath)) {
// read from file
const text = readFromFile(textFilePath);
// pares string to JSON Object
const obj = JSON.parse(text);
}
// Read binary file
const binaryFilePath = "~/Desktop/screenshot.png";
const binaryFile = readFromFile(binaryFilePath); // Uint8Array
// Done
return response;
}
from proxyman.
@NghiaTranUIT Thank you very much; I am amazed by your efficiency. I tried the new beta version you provided, it works fine~
from proxyman.
Awesome, glad it helps you π
from proxyman.
Related Issues (20)
- [BUG] Launch app is slowly if there are a lot of Saved Request HOT 1
- Able to use proxyman with iOS physical device at my home network but not with office network. What could be the reason? HOT 7
- Excessive application memory used by proxyman HOT 5
- WebSocket Response, write to server/client HOT 3
- Snippet Code encrypt/decrypt aes-128-cbc and aes-256-cbc HOT 1
- `Buy Proxyman Pro` Menu Bar Button Does Nothing if All Proxyman Windows Have Been Closed (but app still runs) HOT 2
- β[ERROR] Invalid config file. Please contact the development team at [email protected]. HOT 3
- map local does not apply even with matching url HOT 9
- Long Websocket messages truncated HOT 6
- [Edit & Compose] Add enable/disable header & Param HOT 1
- δΈΊδ»δΉδΈε ¬εΌζΊδ»£η οΌ HOT 3
- Will the future Atlantis Mode support Android? HOT 2
- Error: sharedState is not defined [windows version] HOT 2
- An error occurred when I tried to install proxyman CA on my computer
- [iOS] Opt-out Analytic and Crash Report HOT 1
- [BUG] Missing Copy button for the Port on Device Setup Guide HOT 1
- Improve the UX when users can't access to http://proxy.man/ssl HOT 2
- Session v2 file format HOT 1
- windows port
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxyman.