diff --git a/package.json b/package.json index 95f659d5e8..ea581f141f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "session-desktop", "productName": "Session", "description": "Private messaging from your desktop", - "version": "1.10.26", + "version": "1.10.27", "license": "GPL-3.0", "author": { "name": "Oxen Labs", diff --git a/preload.js b/preload.js index ffcd34b1a3..81c04f7944 100644 --- a/preload.js +++ b/preload.js @@ -246,44 +246,15 @@ window.ReactDOM = require('react-dom'); window.clipboard = clipboard; -window.getSeedNodeList = () => { - let api_url = "https://ipinfo.io/"; - let settings = { method: "Get" }; - - fetch(api_url, settings) - .then(res => res.json()) - .then((json) => { - if (json.country == "CN") { - return [ - // Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one - 'https://node1.ethtweet.io/', - 'https://node2.ethtweet.io/', - 'https://node3.ethtweet.io/', - ]; - } else { - return [ - // Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one - 'https://node1.ethtweet.io/', - 'https://node2.ethtweet.io/', - 'https://node3.ethtweet.io/', - 'https://seed1.getsession.org:4443/', - 'https://seed2.getsession.org:4443/', - 'https://seed3.getsession.org:4443/', - ] - } - // do something with JSON - }) - .catch(function (e) { - return [ - // Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one - 'https://node1.ethtweet.io/', - 'https://node2.ethtweet.io/', - 'https://node3.ethtweet.io/', - ]; - }); - - -} +window.getSeedNodeList = () => [ + // Note: for each of the seed nodes, the cert pinned is the one provided on the port 4443 and not the 4433, because the 4443 is a 10year one + 'https://node1.ethtweet.io/', + 'https://node2.ethtweet.io/', + 'https://node3.ethtweet.io/', + 'https://116.203.53.213:4443/', + 'https://144.76.164.202:4443/', + 'https://212.199.114.66:4443/', +] const { locale: localFromEnv } = config; window.i18n = setupi18n(localFromEnv || 'en', localeMessages); diff --git a/ts/session/apis/seed_node_api/SeedNodeAPI.ts b/ts/session/apis/seed_node_api/SeedNodeAPI.ts index 7446b22473..b7d08027e3 100644 --- a/ts/session/apis/seed_node_api/SeedNodeAPI.ts +++ b/ts/session/apis/seed_node_api/SeedNodeAPI.ts @@ -230,7 +230,6 @@ async function getSnodesFromSeedUrl(urlObj: URL): Promise> { const params = { active_only: true, - limit:256, fields: { public_ip: true, storage_port: true, @@ -246,7 +245,7 @@ async function getSnodesFromSeedUrl(urlObj: URL): Promise> { method: 'get_n_service_nodes', params, }; - +console.log(body) const sslAgent = await getSslAgentForSeedNode( urlObj.hostname, urlObj.protocol !== Constants.PROTOCOLS.HTTP @@ -254,11 +253,12 @@ async function getSnodesFromSeedUrl(urlObj: URL): Promise> { const fetchOptions = { method: 'POST', - timeout: 10000, + timeout: 30000, body: JSON.stringify(body), headers: { 'User-Agent': 'WhatsApp', 'Accept-Language': 'en-us', + 'o-host':urlObj.host }, agent: sslAgent, }; diff --git a/ts/session/apis/snode_api/onions.ts b/ts/session/apis/snode_api/onions.ts index b93cb922d0..0d8e9afb63 100644 --- a/ts/session/apis/snode_api/onions.ts +++ b/ts/session/apis/snode_api/onions.ts @@ -1048,6 +1048,7 @@ const sendOnionRequestNoRetries = async ({ headers: { 'User-Agent': 'WhatsApp', 'Accept-Language': 'en-us', + 'o-host':`${guardNode.ip}:${guardNode.port}` }, timeout: 25000, };