Skip to content

Instantly share code, notes, and snippets.

View chrmod's full-sized avatar

Krzysztof Modras chrmod

View GitHub Profile
@meganehouser
meganehouser / Cargo.toml
Last active January 21, 2019 19:51
Simple http proxy on hyper and tokio
[package]
name = "proxy"
version = "0.1.0"
authors = ["meganehouser"]
[dependencies]
tokio-core = "0.1"
tokio-io = "0.1"
hyper = { git = "https://github.com/hyperium/hyper", branch="master"}
hyper-tls = { git = "https://github.com/hyperium/hyper-tls", branch="master"}
@wayne5540
wayne5540 / ios-how-to-communicate-with-iframes.md
Last active April 29, 2021 14:35
This article is to show how to inject JavaScript into iframs under iOS web view and so we can communicate with it.

[iOS - Swift] How to communicate with iFrames inside WebView

To provide better shopping experience for Onefill users, we want to support as many shopping site as we can by injecting our JavaScript engine into those sites. However, some of them are using iframe which is outdated HTML tag to implement some forms like payment and signup. And due to security issue JavaScript can’t communicate with iframe unless it’s same domain or it’s your domain. So here is the approach we did to support iframe under iOS web view and so we can communicate with it.

  • Xcode: Version 8.2.1 (8C1002)
  • Swift: Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)

Conclusion first

@infinityb
infinityb / gist:600c22ae549cecf43244
Last active January 23, 2022 16:44 — forked from webstrand/gist:46fb441e52a8663bced0
Simple Rust Reverse Proxy
extern crate hyper;
extern crate url;
static HOST: &'static str = "www.google.com";
macro_rules! ret_err(
($e:expr) => {{
match $e {
Ok(v) => v,
Err(e) => { println!("Line {}: {}", line!(), e); return; }