Added libs
This commit is contained in:
29
rendezvous/rendezvousClientApiBlueprint.py
Normal file
29
rendezvous/rendezvousClientApiBlueprint.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from libs.fspn.protocol.server import Server
|
||||
from libs.fspn.protocol.connection import Connection, EVENTS as CONNECTION_EVENTS
|
||||
from libs.api.apiBlueprint import ApiBlueprint
|
||||
|
||||
from flask import jsonify
|
||||
|
||||
import logging
|
||||
import random
|
||||
|
||||
class Blueprint(ApiBlueprint):
|
||||
def routes(self):
|
||||
from .rendezvousClient import RendezvousClient
|
||||
self.module:RendezvousClient = self.module
|
||||
|
||||
@self.blueprint.route('/')
|
||||
def show():
|
||||
return self.module.name
|
||||
|
||||
@self.blueprint.route('/connect')
|
||||
def connect_server():
|
||||
self.module.connect_to_server(('127.0.0.1', 30331))
|
||||
return jsonify()
|
||||
|
||||
@self.blueprint.route('/getRandomPeer')
|
||||
def get_random_peer():
|
||||
self.module.send_get_random_peer()
|
||||
return jsonify({"status":"success"})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user