feat: add HTTP-over-I2P proxy to router daemon
- Add --http-proxy/--proxy [host:port] (default 127.0.0.1:4444) to route .i2p and .b32.i2p HTTP requests over I2P streams - Block clearnet hosts with 403 and reject CONNECT and https:// with 501 - Support ?i2paddresshelper= jump links that register host aliases - Add `just proxy` target and -h/--help usage output - Expire idle ratchet sessions after 300s and add RatchetSessionManager::drop_session for fresh NewSession handshakes - Add NetDb::remove_lease_set2 and bound the outbound pending queue to 64 entries
This commit is contained in:
1 parent
54cfb2faa9
commit
14eae00f5c
15 files changed
+1941
-41
No files matched your search
@@ -236,6 +236,22 @@ pub fn NetDb::get_lease_set2_by_b32(
|
||||
None
|
||||
}
|
||||
|
||||
///|
|
||||
/// Removes any cached `LeaseSet2` for `hash` and returns `true` if one was removed.
|
||||
pub fn NetDb::remove_lease_set2(self : NetDb, hash : @common.Hash) -> Bool {
|
||||
let mut removed = false
|
||||
let mut i = 0
|
||||
while i < self.leasesets.length() {
|
||||
if self.leasesets[i].0 == hash {
|
||||
let _ = self.leasesets.remove(i)
|
||||
removed = true
|
||||
} else {
|
||||
i += 1
|
||||
}
|
||||
}
|
||||
removed
|
||||
}
|
||||
|
||||
///|
|
||||
/// Removes expired `LeaseSet2` entries and returns the number pruned.
|
||||
pub fn NetDb::prune_expired(self : NetDb, now_sec : UInt32) -> Int32 {
|
||||
|
||||
@@ -43,6 +43,7 @@ pub fn NetDb::handle_database_store(Self, Byte, @common.Hash, Bytes, UInt32) ->
|
||||
pub fn NetDb::leaseset_count(Self) -> Int32
|
||||
pub fn NetDb::new() -> Self
|
||||
pub fn NetDb::prune_expired(Self, UInt32) -> Int32
|
||||
pub fn NetDb::remove_lease_set2(Self, @common.Hash) -> Bool
|
||||
pub fn NetDb::router_count(Self) -> Int32
|
||||
pub fn NetDb::store_lease_set2(Self, @common.LeaseSet2, UInt32) -> Bool raise NetDbError
|
||||
pub fn NetDb::store_router_info(Self, @common.RouterInfo) -> Bool raise NetDbError
|
||||
|
||||
Reference in new issue
Block a user