From 8198ed468bcbb3faf01b4d4d54568b7975ea9aa9 Mon Sep 17 00:00:00 2001 From: librelois <elois@ifee.fr> Date: Tue, 31 Oct 2017 03:01:20 +0100 Subject: [PATCH] rename ProxyConf -> ProxiesConf --- app/lib/dal/fileDAL.ts | 2 +- app/lib/dto/ConfDTO.ts | 6 +++--- app/modules/ws2p/lib/WS2PClient.ts | 8 ++------ app/modules/ws2p/lib/WS2PCluster.ts | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/lib/dal/fileDAL.ts b/app/lib/dal/fileDAL.ts index 1298d6a12..267d0f184 100644 --- a/app/lib/dal/fileDAL.ts +++ b/app/lib/dal/fileDAL.ts @@ -15,7 +15,7 @@ import {DBBlock} from "../db/DBBlock" import {DBMembership} from "./sqliteDAL/MembershipDAL" import {MerkleDTO} from "../dto/MerkleDTO" import {CommonConstants} from "../common-libs/constants" -import { ProxyConf } from '../proxy'; +import { ProxiesConf } from '../proxy'; const fs = require('fs') const path = require('path') diff --git a/app/lib/dto/ConfDTO.ts b/app/lib/dto/ConfDTO.ts index cdedf5037..fdd2038b7 100644 --- a/app/lib/dto/ConfDTO.ts +++ b/app/lib/dto/ConfDTO.ts @@ -1,5 +1,5 @@ import {CommonConstants} from "../common-libs/constants" -import { Proxy, ProxyConf } from '../proxy'; +import { ProxiesConf } from '../proxy'; const _ = require('underscore'); const constants = require('../constants'); @@ -47,7 +47,7 @@ export interface KeypairConfDTO { } export interface NetworkConfDTO { - proxyConf: ProxyConf|undefined + proxyConf: ProxiesConf|undefined nobma: boolean remoteport: number remotehost: string|null @@ -136,7 +136,7 @@ export class ConfDTO implements CurrencyConfDTO, KeypairConfDTO, NetworkConfDTO, public homename: string, public memory: boolean, public nobma: boolean, - public proxyConf: ProxyConf|undefined, + public proxyConf: ProxiesConf|undefined, public ws2p?: { privateAccess: boolean publicAccess: boolean diff --git a/app/modules/ws2p/lib/WS2PClient.ts b/app/modules/ws2p/lib/WS2PClient.ts index 0ff0b6178..80a4fd1bd 100644 --- a/app/modules/ws2p/lib/WS2PClient.ts +++ b/app/modules/ws2p/lib/WS2PClient.ts @@ -6,7 +6,7 @@ import {WS2PMessageHandler} from "./impl/WS2PMessageHandler" import {WS2PConstants} from "./constants" import {WS2PStreamer} from "./WS2PStreamer" import {WS2PSingleWriteStream} from "./WS2PSingleWriteStream" -import { Proxies, ProxyConf, Proxy } from '../../../lib/proxy'; +import { ProxiesConf } from '../../../lib/proxy'; import { server } from '../../../../test/integration/tools/toolbox'; export class WS2PClient { @@ -15,16 +15,12 @@ export class WS2PClient { static async connectTo(server:Server, fullEndpointAddress:string, uuid:string, messageHandler:WS2PMessageHandler, expectedPub:string, allowKey:(pub:string)=>Promise<boolean> ) { const k2 = new Key(server.conf.pair.pub, server.conf.pair.sec) - let mySelf = false; - if (server.conf.ws2p && server.conf.ws2p.uuid === uuid) { - let mySelf = true; - } const c = WS2PConnection.newConnectionToAddress( fullEndpointAddress, messageHandler, new WS2PPubkeyLocalAuth(server.conf.currency , k2, allowKey), new WS2PPubkeyRemoteAuth(server.conf.currency, k2, allowKey), - Proxy.wsProxy(fullEndpointAddress, server.conf.proxyConf, mySelf), + ProxiesConf.wsProxy(fullEndpointAddress, server.conf.proxyConf), { connectionTimeout: WS2PConstants.REQUEST_TIMEOUT, requestTimeout: WS2PConstants.REQUEST_TIMEOUT diff --git a/app/modules/ws2p/lib/WS2PCluster.ts b/app/modules/ws2p/lib/WS2PCluster.ts index 93e8119d8..5e785d9ef 100644 --- a/app/modules/ws2p/lib/WS2PCluster.ts +++ b/app/modules/ws2p/lib/WS2PCluster.ts @@ -16,7 +16,7 @@ import {WS2PMessageHandler} from "./impl/WS2PMessageHandler" import { CommonConstants } from '../../../lib/common-libs/constants'; import { Package } from "../../../lib/common/package"; import { Constants } from "../../prover/lib/constants"; -import { ProxyConf, Proxy } from '../../../lib/proxy'; +import { ProxiesConf } from '../../../lib/proxy'; const es = require('event-stream') const nuuid = require('node-uuid') @@ -332,7 +332,7 @@ export class WS2PCluster { const prefered = ((this.server.conf.ws2p && this.server.conf.ws2p.preferedNodes) || []).slice() // Copy // Our key is also a prefered one, so we connect to our siblings prefered.push(this.server.conf.pair.pub) - const imCanReachTorEndpoint = Proxy.canReachTorEndpoint(this.server.conf.proxyConf) + const imCanReachTorEndpoint = ProxiesConf.canReachTorEndpoint(this.server.conf.proxyConf) peers.sort((a, b) => { const aIsPrefered = prefered.indexOf(a.pubkey) !== -1 const bIsPrefered = prefered.indexOf(b.pubkey) !== -1 -- GitLab