proxy intregrieren
-
hallo
ich will das mein contact.h,contact.cpp ändern und das es über proxy läuft
contact.hclass CRoutingZone; class CRoutingBin; class CContact { friend class CRoutingZone; friend class CRoutingBin; public: ~CContact(); CContact(); CContact(const CUInt128 &clientID, uint32 ip, uint16 udpPort, uint16 tcpPort, byte type); CContact(const CUInt128 &clientID, uint32 ip, uint16 udpPort, uint16 tcpPort, byte type, const CUInt128 &target); void getClientID(CUInt128 *id) const; CUInt128 getClientID() const {return m_clientID;} void getClientID(CString *id) const; void setClientID(const CUInt128 &clientID); void getDistance(CUInt128 *distance) const; void getDistance(CString *distance) const; uint32 getIPAddress(void) const; void getIPAddress(CString *ip) const; void setIPAddress(uint32 ip); uint16 getTCPPort(void) const; void getTCPPort(CString *port) const; void setTCPPort(uint16 port); uint16 getUDPPort(void) const; void getUDPPort(CString *port) const; void setUDPPort(uint16 port); byte getType(void) const; void setType(byte type); bool madeContact(void) const; void madeContact(bool val); bool getGuiRefs(void) const { return m_guiRefs; } void setGuiRefs(bool refs) { m_guiRefs = refs; } bool inUse(void) {return (m_inUse>0);} void incUse(void) {m_inUse++;} void decUse(void) {if(m_inUse)m_inUse--;else ASSERT(0);} private: CUInt128 m_clientID; CUInt128 m_distance; uint32 m_ip; uint16 m_tcpPort; uint16 m_udpPort; byte m_type; bool m_madeContact; bool m_guiRefs; time_t m_lastTypeSet; time_t m_expires; uint32 m_inUse; }; } // End namespace
contact.cpp
CContact::~CContact() { if (m_guiRefs) theApp.emuledlg->kademliawnd->ContactRem(this); } CContact::CContact() { m_clientID = 0; m_ip = 0; m_udpPort = 0; m_tcpPort = 0; m_type = 1; m_expires = 0; m_madeContact = false; m_lastTypeSet = time(NULL); m_guiRefs = 0; m_inUse = 0; } CContact::CContact(const CUInt128 &clientID, uint32 ip, uint16 udpPort, uint16 tcpPort, byte type) { m_clientID = clientID; CKademlia::getPrefs()->getKadID(&m_distance); m_distance.xor(clientID); m_ip = ip; m_udpPort = udpPort; m_tcpPort = tcpPort; m_type = 1;//type; Set all new contacts to 1 to avoid spreading dead contacts.. m_expires = 0; m_madeContact = false; m_lastTypeSet = time(NULL); m_guiRefs = 0; m_inUse = 0; } CContact::CContact(const CUInt128 &clientID, uint32 ip, uint16 udpPort, uint16 tcpPort, byte type, const CUInt128 &target) { m_clientID = clientID; m_distance.setValue(target); m_distance.xor(clientID); m_ip = ip; m_udpPort = udpPort; m_tcpPort = tcpPort; m_type = 1;//type; Set all new contacts to 1 to avoid spreading dead contacts.. m_expires = 0; m_madeContact = false; m_lastTypeSet = time(NULL); m_guiRefs = 0; m_inUse = 0; } void CContact::getClientID(CUInt128 *id) const { id->setValue(m_clientID); } void CContact::getClientID(CString *id) const { m_clientID.toHexString(id); } void CContact::setClientID(const CUInt128 &clientID) { m_clientID = clientID; CKademlia::getPrefs()->getKadID(&m_distance); m_distance.xor(clientID); } void CContact::getDistance(CUInt128 *distance) const { distance->setValue(m_distance); } void CContact::getDistance(CString *distance) const { m_distance.toBinaryString(distance); } uint32 CContact::getIPAddress(void) const { return m_ip; } void CContact::getIPAddress(CString *ip) const { CMiscUtils::ipAddressToString(m_ip, ip); } void CContact::setIPAddress(uint32 ip) { m_ip = ip; } uint16 CContact::getTCPPort(void) const { return m_tcpPort; } void CContact::getTCPPort(CString *port) const { port->Format(_T("%ld"), m_tcpPort); } void CContact::setTCPPort(uint16 port) { m_tcpPort = port; } uint16 CContact::getUDPPort(void) const { return m_udpPort; } void CContact::getUDPPort(CString *port) const { port->Format(_T("%ld"), m_udpPort); } void CContact::setUDPPort(uint16 port) { m_udpPort = port; } byte CContact::getType(void) const { return m_type; } void CContact::setType(byte type) { if(type != 0 && time(NULL) - m_lastTypeSet < 10 ) { return; } if(type > 1 ) { m_expires = time(NULL) + SEC(20); m_type = 2; //Just in case.. theApp.emuledlg->kademliawnd->ContactRef(this); return; } m_lastTypeSet = time(NULL); m_type = type; if( m_type == 0 ) m_expires = time(NULL) + HR2S(2); else m_expires = time(NULL) + MIN2S(20); theApp.emuledlg->kademliawnd->ContactRef(this); } bool CContact::madeContact(void) const { return m_madeContact; } void CContact::madeContact(bool val) { m_madeContact = val; if( m_madeContact == true ) setType(0); }
ich wil diesen bereich ändern:
contact.huint32 getIPAddress(void) const; void getIPAddress(CString *ip) const; void setIPAddress(uint32 ip); uint16 getTCPPort(void) const; void getTCPPort(CString *port) const; void setTCPPort(uint16 port); uint16 getUDPPort(void) const; void getUDPPort(CString *port) const; void setUDPPort(uint16 port);
Ip ersetzen mit base64 Destinations und Verbindungen über proxy läuft.
uint32 getIPAddress(void) const; void getIPAddress(CString *ip) const; void setIPAddress(uint32 ip);
es muss über localhost laufen also 127.0.0.1 und port 7654 und es muss nicht als ip funktionieren sondern als base64 destination key:
ivtLWVLaJFWDE-K8ReYgJ6~E6iBYfUd05kR95aVx2KHVgV4KUqm2Q
5j5Qi2aCKTFXtTiuxmXYDz9KH5t2FR3kYUgRVZ4zzMMy1CJXGnc7
ktDpSPkCVxbAEADTVSIMot3l6LuqoLXTZIMgJAuP1xhIuWbs5QUD2A
deXd1TUhzQFff0vWU5SGiHhtvNgvK4kgR9rpLvEJQdp2vUZGOX7WQ1
wTEec6DuRujsPorKlXhj6zE-eV5a73pYF0ZREUbFBJNtLzJ2gwBbKL7qQ
1zHHF4pcNXBYhSjV5nibKp6bijvjH~DcAoo-bU3dKPdmYaX4FPyQtS6Ib
C4CxlU5mr4oqBRFEF9HWTIRS8Ye0vAaAQbQ03sdveLWIL3pjcwy8
XhkjE8SLsS1vhJLlIQWhyfRnasDWvu0eGnZwsZzJEoDed5MPIqc6cJfQ3
GcaVtLkfrzSpGazZFTNZ69YeCvN7tUc1kSRfjXtq-qD9qE3rg7SeAHcHTih
wIPkjslgOkVyCAAAAalso für die kommunikation muss es die base64 nutzen und über proxy 127.0.0.1 port 7654 kommunizieren.
und tcp und udp brauche ich dann nicht.
weis jemand wie ich es definieren muss das was ich vor habe?
es soll base64 nutzen statt ip und über proxy laufen!
-
weis keiner was ich machen könnte?
-
Tschuldigung, nichts für ungut, aber Deutsch ist offentsichtlich nicht deine Muttersprache.
diesen abschitt will ich das es über proxy läuft also nicht mit normaler ip connectet
Was will mir dieser Satz sagen.
-
sorry das ich mich nicht richitg ausdrücken kann,
ich will damit sagen, das ich ip ersetzen will mit base64 destinations und die verbindungen über proxy laufen soll.
-
weis wirklich keiner was ich machen könnte?