Public
Edited
Apr 22, 2024
Insert cell
Insert cell
Insert cell
myIP = {
let pc = new RTCPeerConnection({ iceServers: [] }),
np = function () {};

pc.createDataChannel("");
pc.createOffer(pc.setLocalDescription.bind(pc), np);
return new Promise((keep, drop) => {
pc.onicecandidate = (ice) =>{
var myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(
ice?.candidate?.candidate ?? pc.localDescription.sdp
);
keep(myIP[1] || 'not available');
pc.onicecandidate = np;
}
})
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ax = require('axios@1.3.4/dist/axios.min.js')
Insert cell
needle = module2.needle.default
Insert cell
localIp = (await needle('get','https://api.ipify.org/?format=json')).body
Insert cell
Insert cell
remoteIp = fetch('https://sub.reflow.workers.dev/https://ipwho.is?todate=99996').then(d=>d.json())
Insert cell
Insert cell
Insert cell
deploy("a",async (req,res,ctx)=>{ //res.send({req,ctx,hello:Math.random()})

let agent = new module.hp.
HttpsProxyAgent({
keepAlive: true,
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
scheduling: 'lifo',
proxy:"https://access_token:duirrqb6jg5777g27c9046lc6rv0le802n12f0vfnbq4pht4g8c@ext-ms-ex-ru-ams-pr-p-2.northghost.com:433"})
//let temp = await fetch('https://httpbin.org/ip?json').then(d=>d.json())
let temp = //await needle('get', 'https://httpbin.org/ip?json', { agent })
await ax('https://httpbin.org/ip?json',{httpsAgent:agent})
res.send({temp})
})
Insert cell
proxiedIp = fetch('https://webcode.run/observablehq.com/@dleeftink/get-session-ip;a').then(d=>d.json())
Insert cell
import {deploy} from '@endpointservices/webcode'
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more