proxy.hoppscotch.io (#1532)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
Liyas Thomas
2021-03-14 08:54:15 +05:30
committed by GitHub
parent c6af38f7dc
commit a724dc1207
23 changed files with 62 additions and 61 deletions

View File

@@ -278,7 +278,7 @@ _Collections are synced with cloud / local session storage_
</details>
_Official Hoppscotch Proxy is hosted by Apollo Software - **[Privacy Policy](https://apollosoftware.xyz/legal/postwoman)**_
_Official proxy server is hosted by Hoppscotch - **[GitHub](https://github.com/hoppscotch/proxyscotch)** - **[Privacy Policy](https://github.com/hoppscotch/proxyscotch/wiki/Privacy-policy)**_
📜 **Pre-Request Scripts β:** Snippets of code associated with a request that are executed before the request is sent.

View File

@@ -13,7 +13,7 @@ export const cancelRunningAxiosRequest = () => {
const axiosWithProxy = async (req, { state }) => {
try {
const { data } = await axios.post(
state.postwoman.settings.PROXY_URL || "https://hoppscotch.apollosoftware.xyz/",
state.postwoman.settings.PROXY_URL || "https://proxy.hoppscotch.io",
{
...req,
wantsBinary: true,

View File

@@ -16,18 +16,18 @@ export const cancelRunningExtensionRequest = () => {
}
const extensionWithProxy = async (req, { state }) => {
const backupTimeDataStart = new Date().getTime();
const backupTimeDataStart = new Date().getTime()
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
method: "post",
url: state.postwoman.settings.PROXY_URL || "https://hoppscotch.apollosoftware.xyz/",
url: state.postwoman.settings.PROXY_URL || "https://proxy.hoppscotch.io",
data: {
...req,
wantsBinary: true,
},
})
const backupTimeDataEnd = new Date().getTime();
const backupTimeDataEnd = new Date().getTime()
const parsedData = JSON.parse(res.data)
@@ -40,11 +40,11 @@ const extensionWithProxy = async (req, { state }) => {
}
if (!(res && res.config && res.config.timeData)) {
res.config = {
res.config = {
timeData: {
startTime: backupTimeDataStart,
endTime: backupTimeDataEnd
}
endTime: backupTimeDataEnd,
},
}
}
@@ -54,21 +54,21 @@ const extensionWithProxy = async (req, { state }) => {
}
const extensionWithoutProxy = async (req, _store) => {
const backupTimeDataStart = new Date().getTime();
const backupTimeDataStart = new Date().getTime()
const res = await window.__POSTWOMAN_EXTENSION_HOOK__.sendRequest({
...req,
wantsBinary: true,
})
const backupTimeDataEnd = new Date().getTime();
const backupTimeDataEnd = new Date().getTime()
if (!(res && res.config && res.config.timeData)) {
res.config = {
timeData: {
startTime: backupTimeDataStart,
endTime: backupTimeDataEnd
}
endTime: backupTimeDataEnd,
},
}
}
return res

View File

@@ -83,9 +83,9 @@
"enabled": "কার্যকর",
"disabled": "অকার্যকর",
"proxy": "প্রক্সি",
"postwoman_official_proxy_hosting": "হপস্কচের অফিশিয়াল প্রক্সি অ্যাপোলো সফটওয়্যার হোস্ট করেছে।",
"official_proxy_hosting": "হপস্কচের অফিশিয়াল প্রক্সি অ্যাপোলো সফটওয়্যার হোস্ট করেছে।",
"read_the": "পড়ুন",
"apollosw_privacy_policy": "অ্যাপোলো সফটওয়্যারের গোপনীয়তা ও নীতি",
"proxy_privacy_policy": "অ্যাপোলো সফটওয়্যারের গোপনীয়তা ও নীতি",
"contact_us": "যোগাযোগ করুন",
"connect": "সংযোগ",
"disconnect": "সংযোগ বিচ্ছিন্ন",

View File

@@ -77,9 +77,9 @@
"enabled": "Aktiviert",
"disabled": "Deaktiviert",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "Hoppscotchs offizieller Proxy wird durch Apollo Software bereitgestellt.",
"official_proxy_hosting": "Offizieller Proxy wird durch Hoppscotch bereitgestellt.",
"read_the": "Lies die",
"apollosw_privacy_policy": "Apollo Software Datenschutzerklärung",
"proxy_privacy_policy": "Proxy Datenschutzerklärung",
"contact_us": "Kontaktiere uns",
"connect": "Verbinden",
"disconnect": "Trennen",

View File

@@ -82,9 +82,9 @@
"enabled": "Enabled",
"disabled": "Disabled",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "Hoppscotch's Official Proxy is hosted by Apollo Software.",
"official_proxy_hosting": "Official Proxy is hosted by Hoppscotch.",
"read_the": "Read the",
"apollosw_privacy_policy": "Apollo Software privacy policy",
"proxy_privacy_policy": "Proxy privacy policy",
"contact_us": "Contact us",
"connect": "Connect",
"disconnect": "Disconnect",

View File

@@ -75,9 +75,9 @@
"enabled": "Habilitado",
"disabled": "Deshabilitado",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "El proxy Oficial de Hoppscotch está hospedado en Apollo Software.",
"official_proxy_hosting": "El proxy Oficial está hospedado en Hoppscotch.",
"read_the": "Leer la",
"apollosw_privacy_policy": "Política de privacidad de Apollo Software",
"proxy_privacy_policy": "Política de privacidad de proxy",
"contact_us": "Contáctenos",
"connect": "Conectar",
"disconnect": "Desconectar",

View File

@@ -77,9 +77,9 @@
"enabled": "فعال",
"disabled": "غیر فعال",
"proxy": "پراکسی",
"postwoman_official_proxy_hosting": "پراکسی Hoppscotch برروی هاست Apollo Software قرار دارد.",
"official_proxy_hosting": "پراکسی برروی هاست Hoppscotch قرار دارد.",
"read_the": "بخوانید",
"apollosw_privacy_policy": "خط مشی رازداری Apollo Software",
"proxy_privacy_policy": "خط مشی رازداری proxy",
"contact_us": "Contact us",
"connect": "Connect",
"disconnect": "Disconnect",

View File

@@ -77,9 +77,9 @@
"enabled": "Activé",
"disabled": "Désactivé",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "Le proxy officiel de Hoppscotch est hébergé par Apollo Software.",
"official_proxy_hosting": "Le proxy officiel est hébergé par Hoppscotch.",
"read_the": "Lire la",
"apollosw_privacy_policy": "politique de confidentialité Apollo Software",
"proxy_privacy_policy": "Politique de confidentialité proxy",
"contact_us": "Contactez nous",
"connect": "Relier",
"disconnect": "Déconnecter",

View File

@@ -82,9 +82,9 @@
"enabled": "Nyala",
"disabled": "Mati",
"proxy": "Proksi",
"postwoman_official_proxy_hosting": "Proksi Resmi Hoppscotch diinang oleh Apollo Software.",
"official_proxy_hosting": "Proksi Resmi diinang oleh Hoppscotch.",
"read_the": "Bacalah",
"apollosw_privacy_policy": "kebijakan privasi Apollo Software",
"proxy_privacy_policy": "kebijakan privasi proxy",
"contact_us": "Hubungi kami",
"connect": "Sambungkan",
"disconnect": "Putuskan",

View File

@@ -77,9 +77,9 @@
"enabled": "有効",
"disabled": "無効",
"proxy": "プロキシ",
"postwoman_official_proxy_hosting": "Hoppscotchの公式プロキシは、Apollo Softwareがホストしています",
"official_proxy_hosting": "の公式プロキシは、Hoppscotchがホストしています",
"read_the": "プライバシーポリシー",
"apollosw_privacy_policy": "を読む",
"proxy_privacy_policy": "を読む",
"contact_us": "お問い合わせ",
"connect": "接続",
"disconnect": "切断",

View File

@@ -83,9 +83,9 @@
"enabled": "허용",
"disabled": "허용안함",
"proxy": "프록시",
"postwoman_official_proxy_hosting": "Hoppscotch의 공식적인 프록시는 ApolloTV가 호스트 합니다.",
"official_proxy_hosting": "의 공식적인 프록시는 Hoppscotch가 호스트 합니다.",
"read_the": "Read the",
"apollosw_privacy_policy": "아폴로 소프트웨어 개인정보보호정책",
"proxy_privacy_policy": "아폴로 소프트웨어 개인정보보호정책",
"contact_us": "문의하기",
"connect": "연결",
"disconnect": "연결중지",

View File

@@ -83,9 +83,9 @@
"enabled": "പ്രവർത്തനക്ഷമമാക്കി",
"disabled": "അപ്രാപ്‌തമാക്കി",
"proxy": "പ്രോക്സി",
"postwoman_official_proxy_hosting": "Hoppscotch Pro ദ്യോഗിക പ്രോക്‌സി ഹോസ്റ്റുചെയ്യുന്നത് അപ്പോളോ സോഫ്റ്റ്വെയർ ആണ്.",
"official_proxy_hosting": "പ്രോക്‌സി ഹോസ്റ്റുചെയ്യുന്നത് Hoppscotch സോഫ്റ്റ്വെയർ ആണ്.",
"read_the": "വായിക്കുക",
"apollosw_privacy_policy": "Apollo സോഫ്റ്റ്വെയർ സ്വകാര്യതാ നയം",
"proxy_privacy_policy": "Proxy സോഫ്റ്റ്വെയർ സ്വകാര്യതാ നയം",
"contact_us": "ഞങ്ങളെ സമീപിക്കുക",
"connect": "ബന്ധിപ്പിക്കുക",
"disconnect": "വിച്ഛേദിക്കുക",

View File

@@ -83,9 +83,9 @@
"enabled": "Ingeschakeld",
"disabled": "Uitgeschakeld",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "De officiële proxy van Hoppscotch wordt gehost door Apollo Software.",
"official_proxy_hosting": "De officiële proxy wordt gehost door Hoppscotch.",
"read_the": "Lees het",
"apollosw_privacy_policy": "Apollo Software privacybeleid",
"proxy_privacy_policy": "Proxy privacybeleid",
"contact_us": "Contacteer ons",
"connect": "Verbinden",
"disconnect": "Verbreken",

View File

@@ -77,9 +77,9 @@
"enabled": "Ativado",
"disabled": "Desativado",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "O proxy oficial do Hoppscotch está hospedado no Apollo Software.",
"official_proxy_hosting": "O proxy oficial está hospedado no Hoppscotch.",
"read_the": "Leia o",
"apollosw_privacy_policy": "Política de Privacidade do Apollo Software",
"proxy_privacy_policy": "Política de Privacidade do proxy",
"contact_us": "Fale com a gente",
"connect": "Conectar",
"disconnect": "Desconectar",

View File

@@ -85,9 +85,9 @@
"enabled": "Ativado",
"disabled": "Desativado",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "A proxy oficial do Hoppscotch é alojada por Apollo Software.",
"official_proxy_hosting": "A proxy oficial é alojada por Hoppscotch.",
"read_the": "Leia a",
"apollosw_privacy_policy": "política de privacidade do Apollo Software",
"proxy_privacy_policy": "política de privacidade do proxy",
"contact_us": "Contacto",
"connect": "Ligar",
"disconnect": "Desligar",

View File

@@ -83,9 +83,9 @@
"enabled": "Aktif",
"disabled": "Pasif",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "Hoppscotch Offical Proxy Apollo Software tarafından barındırılmaktadır.",
"official_proxy_hosting": "Offical proxy Hoppscotch tarafından barındırılmaktadır.",
"read_the": "Leer la",
"apollosw_privacy_policy": "Apollo Software Gizlilik Politikaları",
"proxy_privacy_policy": "Proxy Gizlilik Politikaları",
"contact_us": "Bizimle İletişime Geçin",
"connect": "Bağlan",
"disconnect": "Bağlantıyı Kes",

View File

@@ -83,9 +83,9 @@
"enabled": "Đã bật",
"disabled": "Đã tắt",
"proxy": "Proxy",
"postwoman_official_proxy_hosting": "Hoppscotch's Official Proxy được lưu trữ bởi Apollo Software.",
"official_proxy_hosting": "Proxy được lưu trữ bởi Hoppscotch.",
"read_the": "Đọc",
"apollosw_privacy_policy": "Chính sách bảo mật của Apollo Software",
"proxy_privacy_policy": "Chính sách bảo mật của proxy",
"contact_us": "Liên hệ với chúng tôi",
"connect": "Kết nối",
"disconnect": "Ngắt kết nối",

View File

@@ -87,9 +87,9 @@
"enabled": "已启用",
"disabled": "已禁用",
"proxy": "代理",
"postwoman_official_proxy_hosting": "Hoppscotch 的官方代理由 Apollo Software 托管",
"official_proxy_hosting": "官方代理由 Hoppscotch 托管",
"read_the": "阅读",
"apollosw_privacy_policy": "Apollo Software 隐私政策",
"proxy_privacy_policy": "Proxy 隐私政策",
"contact_us": "联系我们",
"connect": "连接",
"disconnect": "断开",

View File

@@ -83,9 +83,9 @@
"enabled": "啟用",
"disabled": "停用",
"proxy": "代理伺服器",
"postwoman_official_proxy_hosting": "Hoppscotch 的官方代理伺服器架設在 Apollo Software。",
"official_proxy_hosting": "的官方代理伺服器架設在 Hoppscotch",
"read_the": "閱讀",
"apollosw_privacy_policy": "Apollo 軟體隱私政策",
"proxy_privacy_policy": "Proxy 軟體隱私政策",
"contact_us": "聯絡我們",
"connect": "連線",
"disconnect": "中斷連線",

View File

@@ -23,6 +23,15 @@ export default {
if (process.client) {
document.body.classList.add("afterLoad")
}
// Migrate old default proxy URL to the new proxy URL (if not set / overridden)
if (
this.$store.state.postwoman.settings.PROXY_URL &&
this.$store.state.postwoman.settings.PROXY_URL === "https://hoppscotch.apollosoftware.xyz/"
) {
this.$store.state.postwoman.settings.PROXY_URL = "https://proxy.hoppscotch.io/"
}
console.log(
"%cWe ❤︎ open source!",
"background-color:white;padding:8px 16px;border-radius:8px;font-size:32px;color:red;"

10
package-lock.json generated
View File

@@ -1918,7 +1918,6 @@
"jest-resolve": "^26.6.2",
"jest-util": "^26.6.2",
"jest-worker": "^26.6.2",
"node-notifier": "^8.0.0",
"slash": "^3.0.0",
"source-map": "^0.6.0",
"string-length": "^4.0.1",
@@ -3630,7 +3629,6 @@
"merge-source-map": "^1.1.0",
"postcss": "^7.0.14",
"postcss-selector-parser": "^6.0.2",
"prettier": "^1.18.2",
"source-map": "~0.6.1",
"vue-template-es2015-compiler": "^1.9.0"
},
@@ -5468,7 +5466,6 @@
"dependencies": {
"anymatch": "~3.1.1",
"braces": "~3.0.2",
"fsevents": "~2.3.1",
"glob-parent": "~5.1.0",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
@@ -7492,8 +7489,7 @@
"esprima": "^4.0.1",
"estraverse": "^4.2.0",
"esutils": "^2.0.2",
"optionator": "^0.8.1",
"source-map": "~0.6.1"
"optionator": "^0.8.1"
},
"bin": {
"escodegen": "bin/escodegen.js",
@@ -10825,7 +10821,6 @@
"@types/node": "*",
"anymatch": "^3.0.3",
"fb-watchman": "^2.0.0",
"fsevents": "^2.1.2",
"graceful-fs": "^4.2.4",
"jest-regex-util": "^26.0.0",
"jest-serializer": "^26.6.2",
@@ -19476,8 +19471,7 @@
"dependencies": {
"chokidar": "^3.4.1",
"graceful-fs": "^4.1.2",
"neo-async": "^2.5.0",
"watchpack-chokidar2": "^2.0.1"
"neo-async": "^2.5.0"
},
"optionalDependencies": {
"watchpack-chokidar2": "^2.0.1"

View File

@@ -121,16 +121,16 @@
:placeholder="$t('url')"
/>
<p class="info">
{{ $t("postwoman_official_proxy_hosting") }}
{{ $t("official_proxy_hosting") }}
<br />
{{ $t("read_the") }}
<a
class="link"
href="https://apollosoftware.xyz/legal/postwoman"
href="https://github.com/hoppscotch/proxyscotch/wiki/Privacy-policy"
target="_blank"
rel="noopener"
>
{{ $t("apollosw_privacy_policy") }} </a
{{ $t("proxy_privacy_policy") }} </a
>.
</p>
</div>
@@ -195,9 +195,7 @@ export default {
: true,
PROXY_ENABLED: this.$store.state.postwoman.settings.PROXY_ENABLED || false,
PROXY_URL:
this.$store.state.postwoman.settings.PROXY_URL ||
"https://hoppscotch.apollosoftware.xyz/",
PROXY_URL: this.$store.state.postwoman.settings.PROXY_URL || "https://proxy.hoppscotch.io",
PROXY_KEY: this.$store.state.postwoman.settings.PROXY_KEY || "",
EXTENSIONS_ENABLED:
@@ -248,7 +246,7 @@ export default {
fb.writeSettings("syncEnvironments", true)
},
resetProxy({ target }) {
this.settings.PROXY_URL = `https://hoppscotch.apollosoftware.xyz/`
this.settings.PROXY_URL = `https://proxy.hoppscotch.io`
target.innerHTML = this.doneButton
this.$toast.info(this.$t("cleared"), {
icon: "clear_all",