-
Notifications
You must be signed in to change notification settings - Fork 12
feat: serve amiusing.requestly.io response inline from the proxy #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dinex-dev
wants to merge
1
commit into
master
Choose a base branch
from
feat/amiusing-builtin-interception
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+243
−9
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 17 additions & 4 deletions
21
dist/components/proxy-middleware/middlewares/amiusing_middleware.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
dist/components/proxy-middleware/middlewares/amiusing_yes_page.d.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const AMIUSING_YES_HTML: "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Am I Using Requestly | Requestly - Intercept & Modify HTTP(s) Requests</title>\n <meta name=\"description\" content=\"Requestly allows you to Intercept & Modify network requests. Main features include Modifying headers, Setting up redirects, Switch hosts, inserting custom scripts and much more\">\n <link href=\"https://fonts.googleapis.com/css?family=Nunito+Sans\" rel=\"stylesheet\">\n <script type=\"application/json\" id=\"amiusing\">{\"amiusing\": true}</script>\n <style>\n *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }\n .container { font-family: \"Nunito Sans\", sans-serif; min-height: 100vh; }\n .grid { display: grid; grid-template-columns: 1fr; }\n @media (min-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } }\n .success, .next {\n display: flex; flex-direction: column; justify-content: center;\n padding: 1rem; min-height: 50vh;\n }\n @media (min-width: 768px) {\n .success, .next { padding: 2rem; min-height: 100vh; }\n }\n .success { background: #0648b3; color: #fff; text-align: center; }\n @media (min-width: 768px) { .success { text-align: right; } }\n .success h1 {\n font-size: 2rem; display: flex; align-items: center; justify-content: center;\n }\n @media (min-width: 768px) {\n .success h1 { font-size: 3.2rem; justify-content: flex-end; }\n }\n .success a { color: #fff; font-weight: 800; }\n .success svg { width: 2rem; margin-right: 0.8rem; }\n @media (min-width: 768px) { .success svg { width: 3rem; } }\n .info { margin-top: 2rem; }\n p + p { margin-top: 0.8rem; }\n .next h2 { font-size: 1.5rem; color: #0648b3; }\n @media (min-width: 768px) { .next h2 { font-size: 2rem; } }\n .next .options {\n margin-top: 2rem; display: flex; flex-direction: column; align-items: flex-start;\n }\n .next a { color: #0648b3; font-weight: 800; }\n .next a::before { content: \"-\"; padding-right: 0.4rem; }\n .next a:hover { color: #0648b3c4; }\n a + a { margin-top: 0.6rem; }\n @media (max-width: 767px) {\n .next .options { align-items: stretch; }\n .next a { padding: 0.5rem 0; word-wrap: break-word; }\n .info { margin-top: 1rem; }\n .info p { font-size: 0.95rem; line-height: 1.5; }\n }\n @media (max-width: 480px) {\n .success h1 { font-size: 1.5rem; }\n .next h2 { font-size: 1.2rem; }\n .success svg { width: 1.5rem; }\n }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <div class=\"grid\">\n <div class=\"success\">\n <h1>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"#fff\">\n <g data-name=\"Layer 2\">\n <g data-name=\"checkmark-circle\">\n <rect width=\"24\" height=\"24\" opacity=\"0\"></rect>\n <path d=\"M9.71 11.29a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 16a1 1 0 0 0 .72-.34l7-8a1 1 0 0 0-1.5-1.32L12 13.54z\"></path>\n <path d=\"M21 11a1 1 0 0 0-1 1 8 8 0 0 1-8 8A8 8 0 0 1 6.33 6.36 7.93 7.93 0 0 1 12 4a8.79 8.79 0 0 1 1.9.22 1 1 0 1 0 .47-1.94A10.54 10.54 0 0 0 12 2a10 10 0 0 0-7 17.09A9.93 9.93 0 0 0 12 22a10 10 0 0 0 10-10 1 1 0 0 0-1-1z\"></path>\n </g>\n </g>\n </svg>\n Success\n </h1>\n <div class=\"info\">\n <p>Your internet traffic is now successfully being transferred through Requestly.</p>\n <p>\n In case you're having trouble accessing HTTPS Website, refer to our troubleshooting guide\n <a href=\"https://docs.requestly.io/desktop-app/troubleshooting\" target=\"_blank\" rel=\"noreferrer noopener\">here</a>.\n </p>\n </div>\n </div>\n <div class=\"next\">\n <h2>What's next you ask ?</h2>\n <div class=\"options\">\n <a href=\"https://docs.requestly.com/general/getting-started--introduction\" target=\"_blank\" rel=\"noreferrer noopener\">Getting started</a>\n <a href=\"https://docs.requestly.com/general/advanced-usage/rule-operators\" target=\"_blank\" rel=\"noreferrer noopener\">Understanding Rule Operators</a>\n <a href=\"https://docs.requestly.com/general/rule-types/modify-headers\" target=\"_blank\" rel=\"noreferrer noopener\">Modify HTTP(s) Headers</a>\n <a href=\"https://docs.requestly.com/general/http-rules--rule-types/modify-response-body\" target=\"_blank\" rel=\"noreferrer noopener\">Modify Response Rule</a>\n <a href=\"https://docs.requestly.com/general/http-rules--rule-types/modify-dominject-scripts\" target=\"_blank\" rel=\"noreferrer noopener\">Inject Javascript or CSS to any website</a>\n <a href=\"https://docs.requestly.com/general/rule-types/replace-strings\" target=\"_blank\" rel=\"noreferrer noopener\">Conditionally replace part of an URL String</a>\n <a href=\"https://docs.requestly.com/general/rule-types/modify-user-agents\" target=\"_blank\" rel=\"noreferrer noopener\">Modify User Agent</a>\n <a href=\"https://docs.requestly.com/general/others/sharing-rules\" target=\"_blank\" rel=\"noreferrer noopener\">Share your Rules</a>\n </div>\n </div>\n </div>\n </div>\n</body>\n</html>"; |
103 changes: 103 additions & 0 deletions
103
dist/components/proxy-middleware/middlewares/amiusing_yes_page.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| "use strict"; | ||
| // Inlined "Success" page served by AmisuingMiddleware when a request to | ||
| // amiusing.requestly.io flows through the Requestly desktop proxy. Mirrors | ||
| // the existing two-column amiusing.requestly.io "Yes" design. | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.AMIUSING_YES_HTML = void 0; | ||
| exports.AMIUSING_YES_HTML = `<!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Am I Using Requestly | Requestly - Intercept & Modify HTTP(s) Requests</title> | ||
| <meta name="description" content="Requestly allows you to Intercept & Modify network requests. Main features include Modifying headers, Setting up redirects, Switch hosts, inserting custom scripts and much more"> | ||
| <link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet"> | ||
| <script type="application/json" id="amiusing">{"amiusing": true}</script> | ||
| <style> | ||
| *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } | ||
| .container { font-family: "Nunito Sans", sans-serif; min-height: 100vh; } | ||
| .grid { display: grid; grid-template-columns: 1fr; } | ||
| @media (min-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } } | ||
| .success, .next { | ||
| display: flex; flex-direction: column; justify-content: center; | ||
| padding: 1rem; min-height: 50vh; | ||
| } | ||
| @media (min-width: 768px) { | ||
| .success, .next { padding: 2rem; min-height: 100vh; } | ||
| } | ||
| .success { background: #0648b3; color: #fff; text-align: center; } | ||
| @media (min-width: 768px) { .success { text-align: right; } } | ||
| .success h1 { | ||
| font-size: 2rem; display: flex; align-items: center; justify-content: center; | ||
| } | ||
| @media (min-width: 768px) { | ||
| .success h1 { font-size: 3.2rem; justify-content: flex-end; } | ||
| } | ||
| .success a { color: #fff; font-weight: 800; } | ||
| .success svg { width: 2rem; margin-right: 0.8rem; } | ||
| @media (min-width: 768px) { .success svg { width: 3rem; } } | ||
| .info { margin-top: 2rem; } | ||
| p + p { margin-top: 0.8rem; } | ||
| .next h2 { font-size: 1.5rem; color: #0648b3; } | ||
| @media (min-width: 768px) { .next h2 { font-size: 2rem; } } | ||
| .next .options { | ||
| margin-top: 2rem; display: flex; flex-direction: column; align-items: flex-start; | ||
| } | ||
| .next a { color: #0648b3; font-weight: 800; } | ||
| .next a::before { content: "-"; padding-right: 0.4rem; } | ||
| .next a:hover { color: #0648b3c4; } | ||
| a + a { margin-top: 0.6rem; } | ||
| @media (max-width: 767px) { | ||
| .next .options { align-items: stretch; } | ||
| .next a { padding: 0.5rem 0; word-wrap: break-word; } | ||
| .info { margin-top: 1rem; } | ||
| .info p { font-size: 0.95rem; line-height: 1.5; } | ||
| } | ||
| @media (max-width: 480px) { | ||
| .success h1 { font-size: 1.5rem; } | ||
| .next h2 { font-size: 1.2rem; } | ||
| .success svg { width: 1.5rem; } | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <div class="grid"> | ||
| <div class="success"> | ||
| <h1> | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"> | ||
| <g data-name="Layer 2"> | ||
| <g data-name="checkmark-circle"> | ||
| <rect width="24" height="24" opacity="0"></rect> | ||
| <path d="M9.71 11.29a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 16a1 1 0 0 0 .72-.34l7-8a1 1 0 0 0-1.5-1.32L12 13.54z"></path> | ||
| <path d="M21 11a1 1 0 0 0-1 1 8 8 0 0 1-8 8A8 8 0 0 1 6.33 6.36 7.93 7.93 0 0 1 12 4a8.79 8.79 0 0 1 1.9.22 1 1 0 1 0 .47-1.94A10.54 10.54 0 0 0 12 2a10 10 0 0 0-7 17.09A9.93 9.93 0 0 0 12 22a10 10 0 0 0 10-10 1 1 0 0 0-1-1z"></path> | ||
| </g> | ||
| </g> | ||
| </svg> | ||
| Success | ||
| </h1> | ||
| <div class="info"> | ||
| <p>Your internet traffic is now successfully being transferred through Requestly.</p> | ||
| <p> | ||
| In case you're having trouble accessing HTTPS Website, refer to our troubleshooting guide | ||
| <a href="https://docs.requestly.io/desktop-app/troubleshooting" target="_blank" rel="noreferrer noopener">here</a>. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| <div class="next"> | ||
| <h2>What's next you ask ?</h2> | ||
| <div class="options"> | ||
| <a href="https://docs.requestly.com/general/getting-started--introduction" target="_blank" rel="noreferrer noopener">Getting started</a> | ||
| <a href="https://docs.requestly.com/general/advanced-usage/rule-operators" target="_blank" rel="noreferrer noopener">Understanding Rule Operators</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/modify-headers" target="_blank" rel="noreferrer noopener">Modify HTTP(s) Headers</a> | ||
| <a href="https://docs.requestly.com/general/http-rules--rule-types/modify-response-body" target="_blank" rel="noreferrer noopener">Modify Response Rule</a> | ||
| <a href="https://docs.requestly.com/general/http-rules--rule-types/modify-dominject-scripts" target="_blank" rel="noreferrer noopener">Inject Javascript or CSS to any website</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/replace-strings" target="_blank" rel="noreferrer noopener">Conditionally replace part of an URL String</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/modify-user-agents" target="_blank" rel="noreferrer noopener">Modify User Agent</a> | ||
| <a href="https://docs.requestly.com/general/others/sharing-rules" target="_blank" rel="noreferrer noopener">Share your Rules</a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html>`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
src/components/proxy-middleware/middlewares/amiusing_yes_page.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| // Inlined "Success" page served by AmisuingMiddleware when a request to | ||
| // amiusing.requestly.io flows through the Requestly desktop proxy. Mirrors | ||
| // the existing two-column amiusing.requestly.io "Yes" design. | ||
|
|
||
| export const AMIUSING_YES_HTML = `<!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Am I Using Requestly | Requestly - Intercept & Modify HTTP(s) Requests</title> | ||
| <meta name="description" content="Requestly allows you to Intercept & Modify network requests. Main features include Modifying headers, Setting up redirects, Switch hosts, inserting custom scripts and much more"> | ||
| <link href="https://fonts.googleapis.com/css?family=Nunito+Sans" rel="stylesheet"> | ||
| <script type="application/json" id="amiusing">{"amiusing": true}</script> | ||
| <style> | ||
| *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } | ||
| .container { font-family: "Nunito Sans", sans-serif; min-height: 100vh; } | ||
| .grid { display: grid; grid-template-columns: 1fr; } | ||
| @media (min-width: 768px) { .grid { grid-template-columns: 1fr 1fr; } } | ||
| .success, .next { | ||
| display: flex; flex-direction: column; justify-content: center; | ||
| padding: 1rem; min-height: 50vh; | ||
| } | ||
| @media (min-width: 768px) { | ||
| .success, .next { padding: 2rem; min-height: 100vh; } | ||
| } | ||
| .success { background: #0648b3; color: #fff; text-align: center; } | ||
| @media (min-width: 768px) { .success { text-align: right; } } | ||
| .success h1 { | ||
| font-size: 2rem; display: flex; align-items: center; justify-content: center; | ||
| } | ||
| @media (min-width: 768px) { | ||
| .success h1 { font-size: 3.2rem; justify-content: flex-end; } | ||
| } | ||
| .success a { color: #fff; font-weight: 800; } | ||
| .success svg { width: 2rem; margin-right: 0.8rem; } | ||
| @media (min-width: 768px) { .success svg { width: 3rem; } } | ||
| .info { margin-top: 2rem; } | ||
| p + p { margin-top: 0.8rem; } | ||
| .next h2 { font-size: 1.5rem; color: #0648b3; } | ||
| @media (min-width: 768px) { .next h2 { font-size: 2rem; } } | ||
| .next .options { | ||
| margin-top: 2rem; display: flex; flex-direction: column; align-items: flex-start; | ||
| } | ||
| .next a { color: #0648b3; font-weight: 800; } | ||
| .next a::before { content: "-"; padding-right: 0.4rem; } | ||
| .next a:hover { color: #0648b3c4; } | ||
| a + a { margin-top: 0.6rem; } | ||
| @media (max-width: 767px) { | ||
| .next .options { align-items: stretch; } | ||
| .next a { padding: 0.5rem 0; word-wrap: break-word; } | ||
| .info { margin-top: 1rem; } | ||
| .info p { font-size: 0.95rem; line-height: 1.5; } | ||
| } | ||
| @media (max-width: 480px) { | ||
| .success h1 { font-size: 1.5rem; } | ||
| .next h2 { font-size: 1.2rem; } | ||
| .success svg { width: 1.5rem; } | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="container"> | ||
| <div class="grid"> | ||
| <div class="success"> | ||
| <h1> | ||
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff"> | ||
| <g data-name="Layer 2"> | ||
| <g data-name="checkmark-circle"> | ||
| <rect width="24" height="24" opacity="0"></rect> | ||
| <path d="M9.71 11.29a1 1 0 0 0-1.42 1.42l3 3A1 1 0 0 0 12 16a1 1 0 0 0 .72-.34l7-8a1 1 0 0 0-1.5-1.32L12 13.54z"></path> | ||
| <path d="M21 11a1 1 0 0 0-1 1 8 8 0 0 1-8 8A8 8 0 0 1 6.33 6.36 7.93 7.93 0 0 1 12 4a8.79 8.79 0 0 1 1.9.22 1 1 0 1 0 .47-1.94A10.54 10.54 0 0 0 12 2a10 10 0 0 0-7 17.09A9.93 9.93 0 0 0 12 22a10 10 0 0 0 10-10 1 1 0 0 0-1-1z"></path> | ||
| </g> | ||
| </g> | ||
| </svg> | ||
| Success | ||
| </h1> | ||
| <div class="info"> | ||
| <p>Your internet traffic is now successfully being transferred through Requestly.</p> | ||
| <p> | ||
| In case you're having trouble accessing HTTPS Website, refer to our troubleshooting guide | ||
| <a href="https://docs.requestly.io/desktop-app/troubleshooting" target="_blank" rel="noreferrer noopener">here</a>. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| <div class="next"> | ||
| <h2>What's next you ask ?</h2> | ||
|
dinex-dev marked this conversation as resolved.
|
||
| <div class="options"> | ||
| <a href="https://docs.requestly.com/general/getting-started--introduction" target="_blank" rel="noreferrer noopener">Getting started</a> | ||
| <a href="https://docs.requestly.com/general/advanced-usage/rule-operators" target="_blank" rel="noreferrer noopener">Understanding Rule Operators</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/modify-headers" target="_blank" rel="noreferrer noopener">Modify HTTP(s) Headers</a> | ||
| <a href="https://docs.requestly.com/general/http-rules--rule-types/modify-response-body" target="_blank" rel="noreferrer noopener">Modify Response Rule</a> | ||
| <a href="https://docs.requestly.com/general/http-rules--rule-types/modify-dominject-scripts" target="_blank" rel="noreferrer noopener">Inject Javascript or CSS to any website</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/replace-strings" target="_blank" rel="noreferrer noopener">Conditionally replace part of an URL String</a> | ||
| <a href="https://docs.requestly.com/general/rule-types/modify-user-agents" target="_blank" rel="noreferrer noopener">Modify User Agent</a> | ||
| <a href="https://docs.requestly.com/general/others/sharing-rules" target="_blank" rel="noreferrer noopener">Share your Rules</a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html>`; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.