linksocks 3.0.12__cp312-cp312-win_amd64.whl → 3.0.13__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of linksocks might be problematic. Click here for more details.
- linksocks/__init__.py +1 -1
- linksocks-3.0.13.dist-info/METADATA +479 -0
- linksocks-3.0.13.dist-info/RECORD +21 -0
- linksockslib/_linksockslib.cp312-win_amd64.h +257 -257
- linksockslib/_linksockslib.cp312-win_amd64.pyd +0 -0
- linksockslib/build.py +211 -211
- linksockslib/go.py +1 -1
- linksockslib/linksocks.py +1490 -1490
- linksockslib/linksockslib.c +2544 -2544
- linksockslib/linksockslib.go +1330 -1330
- linksockslib/linksockslib_go.h +257 -257
- linksocks-3.0.12.dist-info/METADATA +0 -50
- linksocks-3.0.12.dist-info/RECORD +0 -21
- {linksocks-3.0.12.dist-info → linksocks-3.0.13.dist-info}/WHEEL +0 -0
- {linksocks-3.0.12.dist-info → linksocks-3.0.13.dist-info}/entry_points.txt +0 -0
- {linksocks-3.0.12.dist-info → linksocks-3.0.13.dist-info}/top_level.txt +0 -0
linksockslib/linksocks.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# python wrapper for package github.com/linksocks/linksocks/linksocks_go within overall package linksockslib
|
|
3
3
|
# This is what you import to use the package.
|
|
4
4
|
# File is generated by gopy. Do not edit.
|
|
5
|
-
# gopy.EXE build -vm=C:\Users\RUNNER~1\AppData\Local\Temp\
|
|
5
|
+
# gopy.EXE build -vm=C:\Users\RUNNER~1\AppData\Local\Temp\linksocks_pyvenv_rki5036q\venv\Scripts\python.exe -output=D:\a\linksocks\linksocks\_bindings\python\linksockslib -name=linksockslib -no-make=true ./linksocks_go
|
|
6
6
|
|
|
7
7
|
# the following is required to enable dlopen to open the _go.so file
|
|
8
8
|
import os,sys,inspect,collections
|
|
@@ -2548,9 +2548,9 @@ class BaseMessage(go.GoClass):
|
|
|
2548
2548
|
|
|
2549
2549
|
# ---- Structs ---
|
|
2550
2550
|
|
|
2551
|
-
# Python type for struct linksocks.
|
|
2552
|
-
class
|
|
2553
|
-
"""
|
|
2551
|
+
# Python type for struct linksocks.DataMessage
|
|
2552
|
+
class DataMessage(go.GoClass):
|
|
2553
|
+
"""DataMessage represents a data transfer message\n"""
|
|
2554
2554
|
def __init__(self, *args, **kwargs):
|
|
2555
2555
|
"""
|
|
2556
2556
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -2564,21 +2564,45 @@ class LogMessage(go.GoClass):
|
|
|
2564
2564
|
self.handle = args[0].handle
|
|
2565
2565
|
_linksockslib.IncRef(self.handle)
|
|
2566
2566
|
else:
|
|
2567
|
-
self.handle = _linksockslib.
|
|
2567
|
+
self.handle = _linksockslib.linksocks_DataMessage_CTor()
|
|
2568
2568
|
_linksockslib.IncRef(self.handle)
|
|
2569
2569
|
if 0 < len(args):
|
|
2570
|
-
self.
|
|
2571
|
-
if "
|
|
2572
|
-
self.
|
|
2570
|
+
self.Protocol = args[0]
|
|
2571
|
+
if "Protocol" in kwargs:
|
|
2572
|
+
self.Protocol = kwargs["Protocol"]
|
|
2573
2573
|
if 1 < len(args):
|
|
2574
|
-
self.
|
|
2575
|
-
if "
|
|
2576
|
-
self.
|
|
2574
|
+
self.ChannelID = args[1]
|
|
2575
|
+
if "ChannelID" in kwargs:
|
|
2576
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
2577
|
+
if 2 < len(args):
|
|
2578
|
+
self.Data = args[2]
|
|
2579
|
+
if "Data" in kwargs:
|
|
2580
|
+
self.Data = kwargs["Data"]
|
|
2581
|
+
if 3 < len(args):
|
|
2582
|
+
self.Compression = args[3]
|
|
2583
|
+
if "Compression" in kwargs:
|
|
2584
|
+
self.Compression = kwargs["Compression"]
|
|
2585
|
+
if 4 < len(args):
|
|
2586
|
+
self.Address = args[4]
|
|
2587
|
+
if "Address" in kwargs:
|
|
2588
|
+
self.Address = kwargs["Address"]
|
|
2589
|
+
if 5 < len(args):
|
|
2590
|
+
self.Port = args[5]
|
|
2591
|
+
if "Port" in kwargs:
|
|
2592
|
+
self.Port = kwargs["Port"]
|
|
2593
|
+
if 6 < len(args):
|
|
2594
|
+
self.TargetAddr = args[6]
|
|
2595
|
+
if "TargetAddr" in kwargs:
|
|
2596
|
+
self.TargetAddr = kwargs["TargetAddr"]
|
|
2597
|
+
if 7 < len(args):
|
|
2598
|
+
self.TargetPort = args[7]
|
|
2599
|
+
if "TargetPort" in kwargs:
|
|
2600
|
+
self.TargetPort = kwargs["TargetPort"]
|
|
2577
2601
|
def __del__(self):
|
|
2578
2602
|
_linksockslib.DecRef(self.handle)
|
|
2579
2603
|
def __str__(self):
|
|
2580
2604
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2581
|
-
sv = 'linksocks.
|
|
2605
|
+
sv = 'linksocks.DataMessage{'
|
|
2582
2606
|
first = True
|
|
2583
2607
|
for v in pr:
|
|
2584
2608
|
if callable(v[1]):
|
|
@@ -2591,36 +2615,84 @@ class LogMessage(go.GoClass):
|
|
|
2591
2615
|
return sv + '}'
|
|
2592
2616
|
def __repr__(self):
|
|
2593
2617
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2594
|
-
sv = 'linksocks.
|
|
2618
|
+
sv = 'linksocks.DataMessage ( '
|
|
2595
2619
|
for v in pr:
|
|
2596
2620
|
if not callable(v[1]):
|
|
2597
2621
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2598
2622
|
return sv + ')'
|
|
2599
2623
|
@property
|
|
2600
|
-
def
|
|
2601
|
-
return _linksockslib.
|
|
2602
|
-
@
|
|
2603
|
-
def
|
|
2624
|
+
def Protocol(self):
|
|
2625
|
+
return _linksockslib.linksocks_DataMessage_Protocol_Get(self.handle)
|
|
2626
|
+
@Protocol.setter
|
|
2627
|
+
def Protocol(self, value):
|
|
2604
2628
|
if isinstance(value, go.GoClass):
|
|
2605
|
-
_linksockslib.
|
|
2629
|
+
_linksockslib.linksocks_DataMessage_Protocol_Set(self.handle, value.handle)
|
|
2606
2630
|
else:
|
|
2607
|
-
_linksockslib.
|
|
2631
|
+
_linksockslib.linksocks_DataMessage_Protocol_Set(self.handle, value)
|
|
2608
2632
|
@property
|
|
2609
|
-
def
|
|
2610
|
-
return _linksockslib.
|
|
2611
|
-
@
|
|
2612
|
-
def
|
|
2633
|
+
def ChannelID(self):
|
|
2634
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_DataMessage_ChannelID_Get(self.handle))
|
|
2635
|
+
@property
|
|
2636
|
+
def Data(self):
|
|
2637
|
+
return go.Slice_byte(handle=_linksockslib.linksocks_DataMessage_Data_Get(self.handle))
|
|
2638
|
+
@Data.setter
|
|
2639
|
+
def Data(self, value):
|
|
2613
2640
|
if isinstance(value, go.GoClass):
|
|
2614
|
-
_linksockslib.
|
|
2641
|
+
_linksockslib.linksocks_DataMessage_Data_Set(self.handle, value.handle)
|
|
2615
2642
|
else:
|
|
2616
|
-
|
|
2643
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2644
|
+
@property
|
|
2645
|
+
def Compression(self):
|
|
2646
|
+
return _linksockslib.linksocks_DataMessage_Compression_Get(self.handle)
|
|
2647
|
+
@Compression.setter
|
|
2648
|
+
def Compression(self, value):
|
|
2649
|
+
if isinstance(value, go.GoClass):
|
|
2650
|
+
_linksockslib.linksocks_DataMessage_Compression_Set(self.handle, value.handle)
|
|
2651
|
+
else:
|
|
2652
|
+
_linksockslib.linksocks_DataMessage_Compression_Set(self.handle, value)
|
|
2653
|
+
@property
|
|
2654
|
+
def Address(self):
|
|
2655
|
+
return _linksockslib.linksocks_DataMessage_Address_Get(self.handle)
|
|
2656
|
+
@Address.setter
|
|
2657
|
+
def Address(self, value):
|
|
2658
|
+
if isinstance(value, go.GoClass):
|
|
2659
|
+
_linksockslib.linksocks_DataMessage_Address_Set(self.handle, value.handle)
|
|
2660
|
+
else:
|
|
2661
|
+
_linksockslib.linksocks_DataMessage_Address_Set(self.handle, value)
|
|
2662
|
+
@property
|
|
2663
|
+
def Port(self):
|
|
2664
|
+
return _linksockslib.linksocks_DataMessage_Port_Get(self.handle)
|
|
2665
|
+
@Port.setter
|
|
2666
|
+
def Port(self, value):
|
|
2667
|
+
if isinstance(value, go.GoClass):
|
|
2668
|
+
_linksockslib.linksocks_DataMessage_Port_Set(self.handle, value.handle)
|
|
2669
|
+
else:
|
|
2670
|
+
_linksockslib.linksocks_DataMessage_Port_Set(self.handle, value)
|
|
2671
|
+
@property
|
|
2672
|
+
def TargetAddr(self):
|
|
2673
|
+
return _linksockslib.linksocks_DataMessage_TargetAddr_Get(self.handle)
|
|
2674
|
+
@TargetAddr.setter
|
|
2675
|
+
def TargetAddr(self, value):
|
|
2676
|
+
if isinstance(value, go.GoClass):
|
|
2677
|
+
_linksockslib.linksocks_DataMessage_TargetAddr_Set(self.handle, value.handle)
|
|
2678
|
+
else:
|
|
2679
|
+
_linksockslib.linksocks_DataMessage_TargetAddr_Set(self.handle, value)
|
|
2680
|
+
@property
|
|
2681
|
+
def TargetPort(self):
|
|
2682
|
+
return _linksockslib.linksocks_DataMessage_TargetPort_Get(self.handle)
|
|
2683
|
+
@TargetPort.setter
|
|
2684
|
+
def TargetPort(self, value):
|
|
2685
|
+
if isinstance(value, go.GoClass):
|
|
2686
|
+
_linksockslib.linksocks_DataMessage_TargetPort_Set(self.handle, value.handle)
|
|
2687
|
+
else:
|
|
2688
|
+
_linksockslib.linksocks_DataMessage_TargetPort_Set(self.handle, value)
|
|
2617
2689
|
def GetType(self):
|
|
2618
2690
|
"""GetType() str"""
|
|
2619
|
-
return _linksockslib.
|
|
2691
|
+
return _linksockslib.linksocks_DataMessage_GetType(self.handle)
|
|
2620
2692
|
|
|
2621
|
-
# Python type for struct linksocks.
|
|
2622
|
-
class
|
|
2623
|
-
"""
|
|
2693
|
+
# Python type for struct linksocks.DynamicForwarder
|
|
2694
|
+
class DynamicForwarder(go.GoClass):
|
|
2695
|
+
"""DynamicForwarder handles dynamic batching and sending of network data\n"""
|
|
2624
2696
|
def __init__(self, *args, **kwargs):
|
|
2625
2697
|
"""
|
|
2626
2698
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -2634,25 +2706,13 @@ class TokenStatus(go.GoClass):
|
|
|
2634
2706
|
self.handle = args[0].handle
|
|
2635
2707
|
_linksockslib.IncRef(self.handle)
|
|
2636
2708
|
else:
|
|
2637
|
-
self.handle = _linksockslib.
|
|
2709
|
+
self.handle = _linksockslib.linksocks_DynamicForwarder_CTor()
|
|
2638
2710
|
_linksockslib.IncRef(self.handle)
|
|
2639
|
-
if 0 < len(args):
|
|
2640
|
-
self.Token = args[0]
|
|
2641
|
-
if "Token" in kwargs:
|
|
2642
|
-
self.Token = kwargs["Token"]
|
|
2643
|
-
if 1 < len(args):
|
|
2644
|
-
self.Type = args[1]
|
|
2645
|
-
if "Type" in kwargs:
|
|
2646
|
-
self.Type = kwargs["Type"]
|
|
2647
|
-
if 2 < len(args):
|
|
2648
|
-
self.ClientsCount = args[2]
|
|
2649
|
-
if "ClientsCount" in kwargs:
|
|
2650
|
-
self.ClientsCount = kwargs["ClientsCount"]
|
|
2651
2711
|
def __del__(self):
|
|
2652
2712
|
_linksockslib.DecRef(self.handle)
|
|
2653
2713
|
def __str__(self):
|
|
2654
2714
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2655
|
-
sv = 'linksocks.
|
|
2715
|
+
sv = 'linksocks.DynamicForwarder{'
|
|
2656
2716
|
first = True
|
|
2657
2717
|
for v in pr:
|
|
2658
2718
|
if callable(v[1]):
|
|
@@ -2665,42 +2725,33 @@ class TokenStatus(go.GoClass):
|
|
|
2665
2725
|
return sv + '}'
|
|
2666
2726
|
def __repr__(self):
|
|
2667
2727
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2668
|
-
sv = 'linksocks.
|
|
2728
|
+
sv = 'linksocks.DynamicForwarder ( '
|
|
2669
2729
|
for v in pr:
|
|
2670
2730
|
if not callable(v[1]):
|
|
2671
2731
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2672
2732
|
return sv + ')'
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
@property
|
|
2692
|
-
def ClientsCount(self):
|
|
2693
|
-
return _linksockslib.linksocks_TokenStatus_ClientsCount_Get(self.handle)
|
|
2694
|
-
@ClientsCount.setter
|
|
2695
|
-
def ClientsCount(self, value):
|
|
2696
|
-
if isinstance(value, go.GoClass):
|
|
2697
|
-
_linksockslib.linksocks_TokenStatus_ClientsCount_Set(self.handle, value.handle)
|
|
2698
|
-
else:
|
|
2699
|
-
_linksockslib.linksocks_TokenStatus_ClientsCount_Set(self.handle, value)
|
|
2733
|
+
def ProcessReads(self, conn, goRun=False):
|
|
2734
|
+
"""ProcessReads(object conn)
|
|
2735
|
+
|
|
2736
|
+
ProcessReads handles reading from a network connection and forwarding to WebSocket with dynamic batching
|
|
2737
|
+
"""
|
|
2738
|
+
_linksockslib.linksocks_DynamicForwarder_ProcessReads(self.handle, conn.handle, goRun)
|
|
2739
|
+
def ProcessReadsImmediate(self, conn, goRun=False):
|
|
2740
|
+
"""ProcessReadsImmediate(object conn)
|
|
2741
|
+
|
|
2742
|
+
processReadsImmediate handles reading directly without batching
|
|
2743
|
+
"""
|
|
2744
|
+
_linksockslib.linksocks_DynamicForwarder_ProcessReadsImmediate(self.handle, conn.handle, goRun)
|
|
2745
|
+
def ProcessUDPReads(self, conn, goRun=False):
|
|
2746
|
+
"""ProcessUDPReads(object conn)
|
|
2747
|
+
|
|
2748
|
+
ProcessUDPReads handles reading from a UDP connection with appropriate metadata
|
|
2749
|
+
"""
|
|
2750
|
+
_linksockslib.linksocks_DynamicForwarder_ProcessUDPReads(self.handle, conn.handle, goRun)
|
|
2700
2751
|
|
|
2701
|
-
# Python type for struct linksocks.
|
|
2702
|
-
class
|
|
2703
|
-
"""
|
|
2752
|
+
# Python type for struct linksocks.ReverseTokenResult
|
|
2753
|
+
class ReverseTokenResult(go.GoClass):
|
|
2754
|
+
"""ReverseTokenResult represents the result of adding a reverse token\n"""
|
|
2704
2755
|
def __init__(self, *args, **kwargs):
|
|
2705
2756
|
"""
|
|
2706
2757
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -2714,21 +2765,21 @@ class ReverseTokenStatus(TokenStatus):
|
|
|
2714
2765
|
self.handle = args[0].handle
|
|
2715
2766
|
_linksockslib.IncRef(self.handle)
|
|
2716
2767
|
else:
|
|
2717
|
-
self.handle = _linksockslib.
|
|
2768
|
+
self.handle = _linksockslib.linksocks_ReverseTokenResult_CTor()
|
|
2718
2769
|
_linksockslib.IncRef(self.handle)
|
|
2770
|
+
if 0 < len(args):
|
|
2771
|
+
self.Token = args[0]
|
|
2772
|
+
if "Token" in kwargs:
|
|
2773
|
+
self.Token = kwargs["Token"]
|
|
2719
2774
|
if 1 < len(args):
|
|
2720
2775
|
self.Port = args[1]
|
|
2721
2776
|
if "Port" in kwargs:
|
|
2722
2777
|
self.Port = kwargs["Port"]
|
|
2723
|
-
if 2 < len(args):
|
|
2724
|
-
self.ConnectorTokens = args[2]
|
|
2725
|
-
if "ConnectorTokens" in kwargs:
|
|
2726
|
-
self.ConnectorTokens = kwargs["ConnectorTokens"]
|
|
2727
2778
|
def __del__(self):
|
|
2728
2779
|
_linksockslib.DecRef(self.handle)
|
|
2729
2780
|
def __str__(self):
|
|
2730
2781
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2731
|
-
sv = 'linksocks.
|
|
2782
|
+
sv = 'linksocks.ReverseTokenResult{'
|
|
2732
2783
|
first = True
|
|
2733
2784
|
for v in pr:
|
|
2734
2785
|
if callable(v[1]):
|
|
@@ -2741,33 +2792,33 @@ class ReverseTokenStatus(TokenStatus):
|
|
|
2741
2792
|
return sv + '}'
|
|
2742
2793
|
def __repr__(self):
|
|
2743
2794
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2744
|
-
sv = 'linksocks.
|
|
2795
|
+
sv = 'linksocks.ReverseTokenResult ( '
|
|
2745
2796
|
for v in pr:
|
|
2746
2797
|
if not callable(v[1]):
|
|
2747
2798
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2748
2799
|
return sv + ')'
|
|
2749
2800
|
@property
|
|
2750
|
-
def
|
|
2751
|
-
return _linksockslib.
|
|
2752
|
-
@
|
|
2753
|
-
def
|
|
2801
|
+
def Token(self):
|
|
2802
|
+
return _linksockslib.linksocks_ReverseTokenResult_Token_Get(self.handle)
|
|
2803
|
+
@Token.setter
|
|
2804
|
+
def Token(self, value):
|
|
2754
2805
|
if isinstance(value, go.GoClass):
|
|
2755
|
-
_linksockslib.
|
|
2806
|
+
_linksockslib.linksocks_ReverseTokenResult_Token_Set(self.handle, value.handle)
|
|
2756
2807
|
else:
|
|
2757
|
-
_linksockslib.
|
|
2808
|
+
_linksockslib.linksocks_ReverseTokenResult_Token_Set(self.handle, value)
|
|
2758
2809
|
@property
|
|
2759
|
-
def
|
|
2760
|
-
return
|
|
2761
|
-
@
|
|
2762
|
-
def
|
|
2810
|
+
def Port(self):
|
|
2811
|
+
return _linksockslib.linksocks_ReverseTokenResult_Port_Get(self.handle)
|
|
2812
|
+
@Port.setter
|
|
2813
|
+
def Port(self, value):
|
|
2763
2814
|
if isinstance(value, go.GoClass):
|
|
2764
|
-
_linksockslib.
|
|
2815
|
+
_linksockslib.linksocks_ReverseTokenResult_Port_Set(self.handle, value.handle)
|
|
2765
2816
|
else:
|
|
2766
|
-
|
|
2817
|
+
_linksockslib.linksocks_ReverseTokenResult_Port_Set(self.handle, value)
|
|
2767
2818
|
|
|
2768
|
-
# Python type for struct linksocks.
|
|
2769
|
-
class
|
|
2770
|
-
"""
|
|
2819
|
+
# Python type for struct linksocks.StatusResponse
|
|
2820
|
+
class StatusResponse(go.GoClass):
|
|
2821
|
+
"""StatusResponse represents the server status\n"""
|
|
2771
2822
|
def __init__(self, *args, **kwargs):
|
|
2772
2823
|
"""
|
|
2773
2824
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -2781,20 +2832,87 @@ class AuthMessage(go.GoClass):
|
|
|
2781
2832
|
self.handle = args[0].handle
|
|
2782
2833
|
_linksockslib.IncRef(self.handle)
|
|
2783
2834
|
else:
|
|
2784
|
-
self.handle = _linksockslib.
|
|
2835
|
+
self.handle = _linksockslib.linksocks_StatusResponse_CTor()
|
|
2785
2836
|
_linksockslib.IncRef(self.handle)
|
|
2786
2837
|
if 0 < len(args):
|
|
2787
|
-
self.
|
|
2788
|
-
if "
|
|
2789
|
-
self.
|
|
2838
|
+
self.Version = args[0]
|
|
2839
|
+
if "Version" in kwargs:
|
|
2840
|
+
self.Version = kwargs["Version"]
|
|
2790
2841
|
if 1 < len(args):
|
|
2791
|
-
self.
|
|
2792
|
-
if "
|
|
2793
|
-
self.
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2842
|
+
self.Tokens = args[1]
|
|
2843
|
+
if "Tokens" in kwargs:
|
|
2844
|
+
self.Tokens = kwargs["Tokens"]
|
|
2845
|
+
def __del__(self):
|
|
2846
|
+
_linksockslib.DecRef(self.handle)
|
|
2847
|
+
def __str__(self):
|
|
2848
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2849
|
+
sv = 'linksocks.StatusResponse{'
|
|
2850
|
+
first = True
|
|
2851
|
+
for v in pr:
|
|
2852
|
+
if callable(v[1]):
|
|
2853
|
+
continue
|
|
2854
|
+
if first:
|
|
2855
|
+
first = False
|
|
2856
|
+
else:
|
|
2857
|
+
sv += ', '
|
|
2858
|
+
sv += v[0] + '=' + str(v[1])
|
|
2859
|
+
return sv + '}'
|
|
2860
|
+
def __repr__(self):
|
|
2861
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2862
|
+
sv = 'linksocks.StatusResponse ( '
|
|
2863
|
+
for v in pr:
|
|
2864
|
+
if not callable(v[1]):
|
|
2865
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2866
|
+
return sv + ')'
|
|
2867
|
+
@property
|
|
2868
|
+
def Version(self):
|
|
2869
|
+
return _linksockslib.linksocks_StatusResponse_Version_Get(self.handle)
|
|
2870
|
+
@Version.setter
|
|
2871
|
+
def Version(self, value):
|
|
2872
|
+
if isinstance(value, go.GoClass):
|
|
2873
|
+
_linksockslib.linksocks_StatusResponse_Version_Set(self.handle, value.handle)
|
|
2874
|
+
else:
|
|
2875
|
+
_linksockslib.linksocks_StatusResponse_Version_Set(self.handle, value)
|
|
2876
|
+
@property
|
|
2877
|
+
def Tokens(self):
|
|
2878
|
+
return Slice_interface_(handle=_linksockslib.linksocks_StatusResponse_Tokens_Get(self.handle))
|
|
2879
|
+
@Tokens.setter
|
|
2880
|
+
def Tokens(self, value):
|
|
2881
|
+
if isinstance(value, go.GoClass):
|
|
2882
|
+
_linksockslib.linksocks_StatusResponse_Tokens_Set(self.handle, value.handle)
|
|
2883
|
+
else:
|
|
2884
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
2885
|
+
|
|
2886
|
+
# Python type for struct linksocks.AuthMessage
|
|
2887
|
+
class AuthMessage(go.GoClass):
|
|
2888
|
+
"""AuthMessage represents an authentication request\n"""
|
|
2889
|
+
def __init__(self, *args, **kwargs):
|
|
2890
|
+
"""
|
|
2891
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
2892
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
2893
|
+
in which case a new Go object is constructed first
|
|
2894
|
+
"""
|
|
2895
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
2896
|
+
self.handle = kwargs['handle']
|
|
2897
|
+
_linksockslib.IncRef(self.handle)
|
|
2898
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
2899
|
+
self.handle = args[0].handle
|
|
2900
|
+
_linksockslib.IncRef(self.handle)
|
|
2901
|
+
else:
|
|
2902
|
+
self.handle = _linksockslib.linksocks_AuthMessage_CTor()
|
|
2903
|
+
_linksockslib.IncRef(self.handle)
|
|
2904
|
+
if 0 < len(args):
|
|
2905
|
+
self.Token = args[0]
|
|
2906
|
+
if "Token" in kwargs:
|
|
2907
|
+
self.Token = kwargs["Token"]
|
|
2908
|
+
if 1 < len(args):
|
|
2909
|
+
self.Reverse = args[1]
|
|
2910
|
+
if "Reverse" in kwargs:
|
|
2911
|
+
self.Reverse = kwargs["Reverse"]
|
|
2912
|
+
if 2 < len(args):
|
|
2913
|
+
self.Instance = args[2]
|
|
2914
|
+
if "Instance" in kwargs:
|
|
2915
|
+
self.Instance = kwargs["Instance"]
|
|
2798
2916
|
def __del__(self):
|
|
2799
2917
|
_linksockslib.DecRef(self.handle)
|
|
2800
2918
|
def __str__(self):
|
|
@@ -2912,9 +3030,9 @@ class AuthResponseMessage(go.GoClass):
|
|
|
2912
3030
|
"""GetType() str"""
|
|
2913
3031
|
return _linksockslib.linksocks_AuthResponseMessage_GetType(self.handle)
|
|
2914
3032
|
|
|
2915
|
-
# Python type for struct linksocks.
|
|
2916
|
-
class
|
|
2917
|
-
"""
|
|
3033
|
+
# Python type for struct linksocks.LogMessage
|
|
3034
|
+
class LogMessage(go.GoClass):
|
|
3035
|
+
"""LogMessage represents a log message from server to client\n"""
|
|
2918
3036
|
def __init__(self, *args, **kwargs):
|
|
2919
3037
|
"""
|
|
2920
3038
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -2928,45 +3046,21 @@ class DataMessage(go.GoClass):
|
|
|
2928
3046
|
self.handle = args[0].handle
|
|
2929
3047
|
_linksockslib.IncRef(self.handle)
|
|
2930
3048
|
else:
|
|
2931
|
-
self.handle = _linksockslib.
|
|
3049
|
+
self.handle = _linksockslib.linksocks_LogMessage_CTor()
|
|
2932
3050
|
_linksockslib.IncRef(self.handle)
|
|
2933
3051
|
if 0 < len(args):
|
|
2934
|
-
self.
|
|
2935
|
-
if "
|
|
2936
|
-
self.
|
|
3052
|
+
self.Level = args[0]
|
|
3053
|
+
if "Level" in kwargs:
|
|
3054
|
+
self.Level = kwargs["Level"]
|
|
2937
3055
|
if 1 < len(args):
|
|
2938
|
-
self.
|
|
2939
|
-
if "
|
|
2940
|
-
self.
|
|
2941
|
-
if 2 < len(args):
|
|
2942
|
-
self.Data = args[2]
|
|
2943
|
-
if "Data" in kwargs:
|
|
2944
|
-
self.Data = kwargs["Data"]
|
|
2945
|
-
if 3 < len(args):
|
|
2946
|
-
self.Compression = args[3]
|
|
2947
|
-
if "Compression" in kwargs:
|
|
2948
|
-
self.Compression = kwargs["Compression"]
|
|
2949
|
-
if 4 < len(args):
|
|
2950
|
-
self.Address = args[4]
|
|
2951
|
-
if "Address" in kwargs:
|
|
2952
|
-
self.Address = kwargs["Address"]
|
|
2953
|
-
if 5 < len(args):
|
|
2954
|
-
self.Port = args[5]
|
|
2955
|
-
if "Port" in kwargs:
|
|
2956
|
-
self.Port = kwargs["Port"]
|
|
2957
|
-
if 6 < len(args):
|
|
2958
|
-
self.TargetAddr = args[6]
|
|
2959
|
-
if "TargetAddr" in kwargs:
|
|
2960
|
-
self.TargetAddr = kwargs["TargetAddr"]
|
|
2961
|
-
if 7 < len(args):
|
|
2962
|
-
self.TargetPort = args[7]
|
|
2963
|
-
if "TargetPort" in kwargs:
|
|
2964
|
-
self.TargetPort = kwargs["TargetPort"]
|
|
3056
|
+
self.Msg = args[1]
|
|
3057
|
+
if "Msg" in kwargs:
|
|
3058
|
+
self.Msg = kwargs["Msg"]
|
|
2965
3059
|
def __del__(self):
|
|
2966
3060
|
_linksockslib.DecRef(self.handle)
|
|
2967
3061
|
def __str__(self):
|
|
2968
3062
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2969
|
-
sv = 'linksocks.
|
|
3063
|
+
sv = 'linksocks.LogMessage{'
|
|
2970
3064
|
first = True
|
|
2971
3065
|
for v in pr:
|
|
2972
3066
|
if callable(v[1]):
|
|
@@ -2979,84 +3073,36 @@ class DataMessage(go.GoClass):
|
|
|
2979
3073
|
return sv + '}'
|
|
2980
3074
|
def __repr__(self):
|
|
2981
3075
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
2982
|
-
sv = 'linksocks.
|
|
3076
|
+
sv = 'linksocks.LogMessage ( '
|
|
2983
3077
|
for v in pr:
|
|
2984
3078
|
if not callable(v[1]):
|
|
2985
3079
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
2986
3080
|
return sv + ')'
|
|
2987
3081
|
@property
|
|
2988
|
-
def
|
|
2989
|
-
return _linksockslib.
|
|
2990
|
-
@
|
|
2991
|
-
def
|
|
2992
|
-
if isinstance(value, go.GoClass):
|
|
2993
|
-
_linksockslib.linksocks_DataMessage_Protocol_Set(self.handle, value.handle)
|
|
2994
|
-
else:
|
|
2995
|
-
_linksockslib.linksocks_DataMessage_Protocol_Set(self.handle, value)
|
|
2996
|
-
@property
|
|
2997
|
-
def ChannelID(self):
|
|
2998
|
-
return go.uuid_UUID(handle=_linksockslib.linksocks_DataMessage_ChannelID_Get(self.handle))
|
|
2999
|
-
@property
|
|
3000
|
-
def Data(self):
|
|
3001
|
-
return go.Slice_byte(handle=_linksockslib.linksocks_DataMessage_Data_Get(self.handle))
|
|
3002
|
-
@Data.setter
|
|
3003
|
-
def Data(self, value):
|
|
3004
|
-
if isinstance(value, go.GoClass):
|
|
3005
|
-
_linksockslib.linksocks_DataMessage_Data_Set(self.handle, value.handle)
|
|
3006
|
-
else:
|
|
3007
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
3008
|
-
@property
|
|
3009
|
-
def Compression(self):
|
|
3010
|
-
return _linksockslib.linksocks_DataMessage_Compression_Get(self.handle)
|
|
3011
|
-
@Compression.setter
|
|
3012
|
-
def Compression(self, value):
|
|
3013
|
-
if isinstance(value, go.GoClass):
|
|
3014
|
-
_linksockslib.linksocks_DataMessage_Compression_Set(self.handle, value.handle)
|
|
3015
|
-
else:
|
|
3016
|
-
_linksockslib.linksocks_DataMessage_Compression_Set(self.handle, value)
|
|
3017
|
-
@property
|
|
3018
|
-
def Address(self):
|
|
3019
|
-
return _linksockslib.linksocks_DataMessage_Address_Get(self.handle)
|
|
3020
|
-
@Address.setter
|
|
3021
|
-
def Address(self, value):
|
|
3022
|
-
if isinstance(value, go.GoClass):
|
|
3023
|
-
_linksockslib.linksocks_DataMessage_Address_Set(self.handle, value.handle)
|
|
3024
|
-
else:
|
|
3025
|
-
_linksockslib.linksocks_DataMessage_Address_Set(self.handle, value)
|
|
3026
|
-
@property
|
|
3027
|
-
def Port(self):
|
|
3028
|
-
return _linksockslib.linksocks_DataMessage_Port_Get(self.handle)
|
|
3029
|
-
@Port.setter
|
|
3030
|
-
def Port(self, value):
|
|
3031
|
-
if isinstance(value, go.GoClass):
|
|
3032
|
-
_linksockslib.linksocks_DataMessage_Port_Set(self.handle, value.handle)
|
|
3033
|
-
else:
|
|
3034
|
-
_linksockslib.linksocks_DataMessage_Port_Set(self.handle, value)
|
|
3035
|
-
@property
|
|
3036
|
-
def TargetAddr(self):
|
|
3037
|
-
return _linksockslib.linksocks_DataMessage_TargetAddr_Get(self.handle)
|
|
3038
|
-
@TargetAddr.setter
|
|
3039
|
-
def TargetAddr(self, value):
|
|
3082
|
+
def Level(self):
|
|
3083
|
+
return _linksockslib.linksocks_LogMessage_Level_Get(self.handle)
|
|
3084
|
+
@Level.setter
|
|
3085
|
+
def Level(self, value):
|
|
3040
3086
|
if isinstance(value, go.GoClass):
|
|
3041
|
-
_linksockslib.
|
|
3087
|
+
_linksockslib.linksocks_LogMessage_Level_Set(self.handle, value.handle)
|
|
3042
3088
|
else:
|
|
3043
|
-
_linksockslib.
|
|
3089
|
+
_linksockslib.linksocks_LogMessage_Level_Set(self.handle, value)
|
|
3044
3090
|
@property
|
|
3045
|
-
def
|
|
3046
|
-
return _linksockslib.
|
|
3047
|
-
@
|
|
3048
|
-
def
|
|
3091
|
+
def Msg(self):
|
|
3092
|
+
return _linksockslib.linksocks_LogMessage_Msg_Get(self.handle)
|
|
3093
|
+
@Msg.setter
|
|
3094
|
+
def Msg(self, value):
|
|
3049
3095
|
if isinstance(value, go.GoClass):
|
|
3050
|
-
_linksockslib.
|
|
3096
|
+
_linksockslib.linksocks_LogMessage_Msg_Set(self.handle, value.handle)
|
|
3051
3097
|
else:
|
|
3052
|
-
_linksockslib.
|
|
3098
|
+
_linksockslib.linksocks_LogMessage_Msg_Set(self.handle, value)
|
|
3053
3099
|
def GetType(self):
|
|
3054
3100
|
"""GetType() str"""
|
|
3055
|
-
return _linksockslib.
|
|
3101
|
+
return _linksockslib.linksocks_LogMessage_GetType(self.handle)
|
|
3056
3102
|
|
|
3057
|
-
# Python type for struct linksocks.
|
|
3058
|
-
class
|
|
3059
|
-
"""
|
|
3103
|
+
# Python type for struct linksocks.ServerOption
|
|
3104
|
+
class ServerOption(go.GoClass):
|
|
3105
|
+
"""ServerOption represents configuration options for LinkSocksServer\n"""
|
|
3060
3106
|
def __init__(self, *args, **kwargs):
|
|
3061
3107
|
"""
|
|
3062
3108
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -3070,197 +3116,24 @@ class ReverseTokenOptions(go.GoClass):
|
|
|
3070
3116
|
self.handle = args[0].handle
|
|
3071
3117
|
_linksockslib.IncRef(self.handle)
|
|
3072
3118
|
else:
|
|
3073
|
-
self.handle = _linksockslib.
|
|
3119
|
+
self.handle = _linksockslib.linksocks_ServerOption_CTor()
|
|
3074
3120
|
_linksockslib.IncRef(self.handle)
|
|
3075
3121
|
if 0 < len(args):
|
|
3076
|
-
self.
|
|
3077
|
-
if "
|
|
3078
|
-
self.
|
|
3122
|
+
self.WSHost = args[0]
|
|
3123
|
+
if "WSHost" in kwargs:
|
|
3124
|
+
self.WSHost = kwargs["WSHost"]
|
|
3079
3125
|
if 1 < len(args):
|
|
3080
|
-
self.
|
|
3081
|
-
if "
|
|
3082
|
-
self.
|
|
3126
|
+
self.WSPort = args[1]
|
|
3127
|
+
if "WSPort" in kwargs:
|
|
3128
|
+
self.WSPort = kwargs["WSPort"]
|
|
3083
3129
|
if 2 < len(args):
|
|
3084
|
-
self.
|
|
3085
|
-
if "
|
|
3086
|
-
self.
|
|
3130
|
+
self.SocksHost = args[2]
|
|
3131
|
+
if "SocksHost" in kwargs:
|
|
3132
|
+
self.SocksHost = kwargs["SocksHost"]
|
|
3087
3133
|
if 3 < len(args):
|
|
3088
|
-
self.
|
|
3089
|
-
if "
|
|
3090
|
-
self.
|
|
3091
|
-
if 4 < len(args):
|
|
3092
|
-
self.AllowManageConnector = args[4]
|
|
3093
|
-
if "AllowManageConnector" in kwargs:
|
|
3094
|
-
self.AllowManageConnector = kwargs["AllowManageConnector"]
|
|
3095
|
-
def __del__(self):
|
|
3096
|
-
_linksockslib.DecRef(self.handle)
|
|
3097
|
-
def __str__(self):
|
|
3098
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3099
|
-
sv = 'linksocks.ReverseTokenOptions{'
|
|
3100
|
-
first = True
|
|
3101
|
-
for v in pr:
|
|
3102
|
-
if callable(v[1]):
|
|
3103
|
-
continue
|
|
3104
|
-
if first:
|
|
3105
|
-
first = False
|
|
3106
|
-
else:
|
|
3107
|
-
sv += ', '
|
|
3108
|
-
sv += v[0] + '=' + str(v[1])
|
|
3109
|
-
return sv + '}'
|
|
3110
|
-
def __repr__(self):
|
|
3111
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3112
|
-
sv = 'linksocks.ReverseTokenOptions ( '
|
|
3113
|
-
for v in pr:
|
|
3114
|
-
if not callable(v[1]):
|
|
3115
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
|
3116
|
-
return sv + ')'
|
|
3117
|
-
@property
|
|
3118
|
-
def Token(self):
|
|
3119
|
-
return _linksockslib.linksocks_ReverseTokenOptions_Token_Get(self.handle)
|
|
3120
|
-
@Token.setter
|
|
3121
|
-
def Token(self, value):
|
|
3122
|
-
if isinstance(value, go.GoClass):
|
|
3123
|
-
_linksockslib.linksocks_ReverseTokenOptions_Token_Set(self.handle, value.handle)
|
|
3124
|
-
else:
|
|
3125
|
-
_linksockslib.linksocks_ReverseTokenOptions_Token_Set(self.handle, value)
|
|
3126
|
-
@property
|
|
3127
|
-
def Port(self):
|
|
3128
|
-
return _linksockslib.linksocks_ReverseTokenOptions_Port_Get(self.handle)
|
|
3129
|
-
@Port.setter
|
|
3130
|
-
def Port(self, value):
|
|
3131
|
-
if isinstance(value, go.GoClass):
|
|
3132
|
-
_linksockslib.linksocks_ReverseTokenOptions_Port_Set(self.handle, value.handle)
|
|
3133
|
-
else:
|
|
3134
|
-
_linksockslib.linksocks_ReverseTokenOptions_Port_Set(self.handle, value)
|
|
3135
|
-
@property
|
|
3136
|
-
def Username(self):
|
|
3137
|
-
return _linksockslib.linksocks_ReverseTokenOptions_Username_Get(self.handle)
|
|
3138
|
-
@Username.setter
|
|
3139
|
-
def Username(self, value):
|
|
3140
|
-
if isinstance(value, go.GoClass):
|
|
3141
|
-
_linksockslib.linksocks_ReverseTokenOptions_Username_Set(self.handle, value.handle)
|
|
3142
|
-
else:
|
|
3143
|
-
_linksockslib.linksocks_ReverseTokenOptions_Username_Set(self.handle, value)
|
|
3144
|
-
@property
|
|
3145
|
-
def Password(self):
|
|
3146
|
-
return _linksockslib.linksocks_ReverseTokenOptions_Password_Get(self.handle)
|
|
3147
|
-
@Password.setter
|
|
3148
|
-
def Password(self, value):
|
|
3149
|
-
if isinstance(value, go.GoClass):
|
|
3150
|
-
_linksockslib.linksocks_ReverseTokenOptions_Password_Set(self.handle, value.handle)
|
|
3151
|
-
else:
|
|
3152
|
-
_linksockslib.linksocks_ReverseTokenOptions_Password_Set(self.handle, value)
|
|
3153
|
-
@property
|
|
3154
|
-
def AllowManageConnector(self):
|
|
3155
|
-
return _linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Get(self.handle)
|
|
3156
|
-
@AllowManageConnector.setter
|
|
3157
|
-
def AllowManageConnector(self, value):
|
|
3158
|
-
if isinstance(value, go.GoClass):
|
|
3159
|
-
_linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Set(self.handle, value.handle)
|
|
3160
|
-
else:
|
|
3161
|
-
_linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Set(self.handle, value)
|
|
3162
|
-
|
|
3163
|
-
# Python type for struct linksocks.ReverseTokenResult
|
|
3164
|
-
class ReverseTokenResult(go.GoClass):
|
|
3165
|
-
"""ReverseTokenResult represents the result of adding a reverse token\n"""
|
|
3166
|
-
def __init__(self, *args, **kwargs):
|
|
3167
|
-
"""
|
|
3168
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
3169
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
3170
|
-
in which case a new Go object is constructed first
|
|
3171
|
-
"""
|
|
3172
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
3173
|
-
self.handle = kwargs['handle']
|
|
3174
|
-
_linksockslib.IncRef(self.handle)
|
|
3175
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
3176
|
-
self.handle = args[0].handle
|
|
3177
|
-
_linksockslib.IncRef(self.handle)
|
|
3178
|
-
else:
|
|
3179
|
-
self.handle = _linksockslib.linksocks_ReverseTokenResult_CTor()
|
|
3180
|
-
_linksockslib.IncRef(self.handle)
|
|
3181
|
-
if 0 < len(args):
|
|
3182
|
-
self.Token = args[0]
|
|
3183
|
-
if "Token" in kwargs:
|
|
3184
|
-
self.Token = kwargs["Token"]
|
|
3185
|
-
if 1 < len(args):
|
|
3186
|
-
self.Port = args[1]
|
|
3187
|
-
if "Port" in kwargs:
|
|
3188
|
-
self.Port = kwargs["Port"]
|
|
3189
|
-
def __del__(self):
|
|
3190
|
-
_linksockslib.DecRef(self.handle)
|
|
3191
|
-
def __str__(self):
|
|
3192
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3193
|
-
sv = 'linksocks.ReverseTokenResult{'
|
|
3194
|
-
first = True
|
|
3195
|
-
for v in pr:
|
|
3196
|
-
if callable(v[1]):
|
|
3197
|
-
continue
|
|
3198
|
-
if first:
|
|
3199
|
-
first = False
|
|
3200
|
-
else:
|
|
3201
|
-
sv += ', '
|
|
3202
|
-
sv += v[0] + '=' + str(v[1])
|
|
3203
|
-
return sv + '}'
|
|
3204
|
-
def __repr__(self):
|
|
3205
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3206
|
-
sv = 'linksocks.ReverseTokenResult ( '
|
|
3207
|
-
for v in pr:
|
|
3208
|
-
if not callable(v[1]):
|
|
3209
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
|
3210
|
-
return sv + ')'
|
|
3211
|
-
@property
|
|
3212
|
-
def Token(self):
|
|
3213
|
-
return _linksockslib.linksocks_ReverseTokenResult_Token_Get(self.handle)
|
|
3214
|
-
@Token.setter
|
|
3215
|
-
def Token(self, value):
|
|
3216
|
-
if isinstance(value, go.GoClass):
|
|
3217
|
-
_linksockslib.linksocks_ReverseTokenResult_Token_Set(self.handle, value.handle)
|
|
3218
|
-
else:
|
|
3219
|
-
_linksockslib.linksocks_ReverseTokenResult_Token_Set(self.handle, value)
|
|
3220
|
-
@property
|
|
3221
|
-
def Port(self):
|
|
3222
|
-
return _linksockslib.linksocks_ReverseTokenResult_Port_Get(self.handle)
|
|
3223
|
-
@Port.setter
|
|
3224
|
-
def Port(self, value):
|
|
3225
|
-
if isinstance(value, go.GoClass):
|
|
3226
|
-
_linksockslib.linksocks_ReverseTokenResult_Port_Set(self.handle, value.handle)
|
|
3227
|
-
else:
|
|
3228
|
-
_linksockslib.linksocks_ReverseTokenResult_Port_Set(self.handle, value)
|
|
3229
|
-
|
|
3230
|
-
# Python type for struct linksocks.ServerOption
|
|
3231
|
-
class ServerOption(go.GoClass):
|
|
3232
|
-
"""ServerOption represents configuration options for LinkSocksServer\n"""
|
|
3233
|
-
def __init__(self, *args, **kwargs):
|
|
3234
|
-
"""
|
|
3235
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
3236
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
3237
|
-
in which case a new Go object is constructed first
|
|
3238
|
-
"""
|
|
3239
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
3240
|
-
self.handle = kwargs['handle']
|
|
3241
|
-
_linksockslib.IncRef(self.handle)
|
|
3242
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
3243
|
-
self.handle = args[0].handle
|
|
3244
|
-
_linksockslib.IncRef(self.handle)
|
|
3245
|
-
else:
|
|
3246
|
-
self.handle = _linksockslib.linksocks_ServerOption_CTor()
|
|
3247
|
-
_linksockslib.IncRef(self.handle)
|
|
3248
|
-
if 0 < len(args):
|
|
3249
|
-
self.WSHost = args[0]
|
|
3250
|
-
if "WSHost" in kwargs:
|
|
3251
|
-
self.WSHost = kwargs["WSHost"]
|
|
3252
|
-
if 1 < len(args):
|
|
3253
|
-
self.WSPort = args[1]
|
|
3254
|
-
if "WSPort" in kwargs:
|
|
3255
|
-
self.WSPort = kwargs["WSPort"]
|
|
3256
|
-
if 2 < len(args):
|
|
3257
|
-
self.SocksHost = args[2]
|
|
3258
|
-
if "SocksHost" in kwargs:
|
|
3259
|
-
self.SocksHost = kwargs["SocksHost"]
|
|
3260
|
-
if 3 < len(args):
|
|
3261
|
-
self.PortPool = args[3]
|
|
3262
|
-
if "PortPool" in kwargs:
|
|
3263
|
-
self.PortPool = kwargs["PortPool"]
|
|
3134
|
+
self.PortPool = args[3]
|
|
3135
|
+
if "PortPool" in kwargs:
|
|
3136
|
+
self.PortPool = kwargs["PortPool"]
|
|
3264
3137
|
if 4 < len(args):
|
|
3265
3138
|
self.SocksWaitClient = args[4]
|
|
3266
3139
|
if "SocksWaitClient" in kwargs:
|
|
@@ -3528,9 +3401,9 @@ class ServerOption(go.GoClass):
|
|
|
3528
3401
|
"""
|
|
3529
3402
|
return ServerOption(handle=_linksockslib.linksocks_ServerOption_WithUpstreamAuth(self.handle, username, password))
|
|
3530
3403
|
|
|
3531
|
-
# Python type for struct linksocks.
|
|
3532
|
-
class
|
|
3533
|
-
"""
|
|
3404
|
+
# Python type for struct linksocks.ConnectorMessage
|
|
3405
|
+
class ConnectorMessage(go.GoClass):
|
|
3406
|
+
"""ConnectorMessage represents a connector management command from reverse client\n"""
|
|
3534
3407
|
def __init__(self, *args, **kwargs):
|
|
3535
3408
|
"""
|
|
3536
3409
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -3544,41 +3417,25 @@ class TokenRequest(go.GoClass):
|
|
|
3544
3417
|
self.handle = args[0].handle
|
|
3545
3418
|
_linksockslib.IncRef(self.handle)
|
|
3546
3419
|
else:
|
|
3547
|
-
self.handle = _linksockslib.
|
|
3420
|
+
self.handle = _linksockslib.linksocks_ConnectorMessage_CTor()
|
|
3548
3421
|
_linksockslib.IncRef(self.handle)
|
|
3549
3422
|
if 0 < len(args):
|
|
3550
|
-
self.
|
|
3551
|
-
if "
|
|
3552
|
-
self.
|
|
3423
|
+
self.ChannelID = args[0]
|
|
3424
|
+
if "ChannelID" in kwargs:
|
|
3425
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
3553
3426
|
if 1 < len(args):
|
|
3554
|
-
self.
|
|
3555
|
-
if "
|
|
3556
|
-
self.
|
|
3427
|
+
self.ConnectorToken = args[1]
|
|
3428
|
+
if "ConnectorToken" in kwargs:
|
|
3429
|
+
self.ConnectorToken = kwargs["ConnectorToken"]
|
|
3557
3430
|
if 2 < len(args):
|
|
3558
|
-
self.
|
|
3559
|
-
if "
|
|
3560
|
-
self.
|
|
3561
|
-
if 3 < len(args):
|
|
3562
|
-
self.Username = args[3]
|
|
3563
|
-
if "Username" in kwargs:
|
|
3564
|
-
self.Username = kwargs["Username"]
|
|
3565
|
-
if 4 < len(args):
|
|
3566
|
-
self.Password = args[4]
|
|
3567
|
-
if "Password" in kwargs:
|
|
3568
|
-
self.Password = kwargs["Password"]
|
|
3569
|
-
if 5 < len(args):
|
|
3570
|
-
self.ReverseToken = args[5]
|
|
3571
|
-
if "ReverseToken" in kwargs:
|
|
3572
|
-
self.ReverseToken = kwargs["ReverseToken"]
|
|
3573
|
-
if 6 < len(args):
|
|
3574
|
-
self.AllowManageConnector = args[6]
|
|
3575
|
-
if "AllowManageConnector" in kwargs:
|
|
3576
|
-
self.AllowManageConnector = kwargs["AllowManageConnector"]
|
|
3431
|
+
self.Operation = args[2]
|
|
3432
|
+
if "Operation" in kwargs:
|
|
3433
|
+
self.Operation = kwargs["Operation"]
|
|
3577
3434
|
def __del__(self):
|
|
3578
3435
|
_linksockslib.DecRef(self.handle)
|
|
3579
3436
|
def __str__(self):
|
|
3580
3437
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3581
|
-
sv = 'linksocks.
|
|
3438
|
+
sv = 'linksocks.ConnectorMessage{'
|
|
3582
3439
|
first = True
|
|
3583
3440
|
for v in pr:
|
|
3584
3441
|
if callable(v[1]):
|
|
@@ -3591,98 +3448,75 @@ class TokenRequest(go.GoClass):
|
|
|
3591
3448
|
return sv + '}'
|
|
3592
3449
|
def __repr__(self):
|
|
3593
3450
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3594
|
-
sv = 'linksocks.
|
|
3451
|
+
sv = 'linksocks.ConnectorMessage ( '
|
|
3595
3452
|
for v in pr:
|
|
3596
3453
|
if not callable(v[1]):
|
|
3597
3454
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
3598
3455
|
return sv + ')'
|
|
3599
3456
|
@property
|
|
3600
|
-
def
|
|
3601
|
-
return _linksockslib.
|
|
3602
|
-
@Type.setter
|
|
3603
|
-
def Type(self, value):
|
|
3604
|
-
if isinstance(value, go.GoClass):
|
|
3605
|
-
_linksockslib.linksocks_TokenRequest_Type_Set(self.handle, value.handle)
|
|
3606
|
-
else:
|
|
3607
|
-
_linksockslib.linksocks_TokenRequest_Type_Set(self.handle, value)
|
|
3457
|
+
def ChannelID(self):
|
|
3458
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_ConnectorMessage_ChannelID_Get(self.handle))
|
|
3608
3459
|
@property
|
|
3609
|
-
def
|
|
3610
|
-
return _linksockslib.
|
|
3611
|
-
@
|
|
3612
|
-
def
|
|
3460
|
+
def ConnectorToken(self):
|
|
3461
|
+
return _linksockslib.linksocks_ConnectorMessage_ConnectorToken_Get(self.handle)
|
|
3462
|
+
@ConnectorToken.setter
|
|
3463
|
+
def ConnectorToken(self, value):
|
|
3613
3464
|
if isinstance(value, go.GoClass):
|
|
3614
|
-
_linksockslib.
|
|
3465
|
+
_linksockslib.linksocks_ConnectorMessage_ConnectorToken_Set(self.handle, value.handle)
|
|
3615
3466
|
else:
|
|
3616
|
-
_linksockslib.
|
|
3467
|
+
_linksockslib.linksocks_ConnectorMessage_ConnectorToken_Set(self.handle, value)
|
|
3617
3468
|
@property
|
|
3618
|
-
def
|
|
3619
|
-
return _linksockslib.
|
|
3620
|
-
@
|
|
3621
|
-
def
|
|
3469
|
+
def Operation(self):
|
|
3470
|
+
return _linksockslib.linksocks_ConnectorMessage_Operation_Get(self.handle)
|
|
3471
|
+
@Operation.setter
|
|
3472
|
+
def Operation(self, value):
|
|
3622
3473
|
if isinstance(value, go.GoClass):
|
|
3623
|
-
_linksockslib.
|
|
3474
|
+
_linksockslib.linksocks_ConnectorMessage_Operation_Set(self.handle, value.handle)
|
|
3624
3475
|
else:
|
|
3625
|
-
_linksockslib.
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
return _linksockslib.
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3476
|
+
_linksockslib.linksocks_ConnectorMessage_Operation_Set(self.handle, value)
|
|
3477
|
+
def GetType(self):
|
|
3478
|
+
"""GetType() str"""
|
|
3479
|
+
return _linksockslib.linksocks_ConnectorMessage_GetType(self.handle)
|
|
3480
|
+
|
|
3481
|
+
# Python type for struct linksocks.ConnectorResponseMessage
|
|
3482
|
+
class ConnectorResponseMessage(go.GoClass):
|
|
3483
|
+
"""ConnectorResponseMessage represents a connector management response\n"""
|
|
3484
|
+
def __init__(self, *args, **kwargs):
|
|
3485
|
+
"""
|
|
3486
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
3487
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
3488
|
+
in which case a new Go object is constructed first
|
|
3489
|
+
"""
|
|
3490
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
3491
|
+
self.handle = kwargs['handle']
|
|
3492
|
+
_linksockslib.IncRef(self.handle)
|
|
3493
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
3494
|
+
self.handle = args[0].handle
|
|
3495
|
+
_linksockslib.IncRef(self.handle)
|
|
3633
3496
|
else:
|
|
3634
|
-
|
|
3635
|
-
@property
|
|
3636
|
-
def Password(self):
|
|
3637
|
-
return _linksockslib.linksocks_TokenRequest_Password_Get(self.handle)
|
|
3638
|
-
@Password.setter
|
|
3639
|
-
def Password(self, value):
|
|
3640
|
-
if isinstance(value, go.GoClass):
|
|
3641
|
-
_linksockslib.linksocks_TokenRequest_Password_Set(self.handle, value.handle)
|
|
3642
|
-
else:
|
|
3643
|
-
_linksockslib.linksocks_TokenRequest_Password_Set(self.handle, value)
|
|
3644
|
-
@property
|
|
3645
|
-
def ReverseToken(self):
|
|
3646
|
-
return _linksockslib.linksocks_TokenRequest_ReverseToken_Get(self.handle)
|
|
3647
|
-
@ReverseToken.setter
|
|
3648
|
-
def ReverseToken(self, value):
|
|
3649
|
-
if isinstance(value, go.GoClass):
|
|
3650
|
-
_linksockslib.linksocks_TokenRequest_ReverseToken_Set(self.handle, value.handle)
|
|
3651
|
-
else:
|
|
3652
|
-
_linksockslib.linksocks_TokenRequest_ReverseToken_Set(self.handle, value)
|
|
3653
|
-
@property
|
|
3654
|
-
def AllowManageConnector(self):
|
|
3655
|
-
return _linksockslib.linksocks_TokenRequest_AllowManageConnector_Get(self.handle)
|
|
3656
|
-
@AllowManageConnector.setter
|
|
3657
|
-
def AllowManageConnector(self, value):
|
|
3658
|
-
if isinstance(value, go.GoClass):
|
|
3659
|
-
_linksockslib.linksocks_TokenRequest_AllowManageConnector_Set(self.handle, value.handle)
|
|
3660
|
-
else:
|
|
3661
|
-
_linksockslib.linksocks_TokenRequest_AllowManageConnector_Set(self.handle, value)
|
|
3662
|
-
|
|
3663
|
-
# Python type for struct linksocks.WSConn
|
|
3664
|
-
class WSConn(go.GoClass):
|
|
3665
|
-
"""WSConn wraps a websocket.Conn with mutex protection\n"""
|
|
3666
|
-
def __init__(self, *args, **kwargs):
|
|
3667
|
-
"""
|
|
3668
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
3669
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
3670
|
-
in which case a new Go object is constructed first
|
|
3671
|
-
"""
|
|
3672
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
3673
|
-
self.handle = kwargs['handle']
|
|
3674
|
-
_linksockslib.IncRef(self.handle)
|
|
3675
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
3676
|
-
self.handle = args[0].handle
|
|
3677
|
-
_linksockslib.IncRef(self.handle)
|
|
3678
|
-
else:
|
|
3679
|
-
self.handle = _linksockslib.linksocks_WSConn_CTor()
|
|
3497
|
+
self.handle = _linksockslib.linksocks_ConnectorResponseMessage_CTor()
|
|
3680
3498
|
_linksockslib.IncRef(self.handle)
|
|
3499
|
+
if 0 < len(args):
|
|
3500
|
+
self.Success = args[0]
|
|
3501
|
+
if "Success" in kwargs:
|
|
3502
|
+
self.Success = kwargs["Success"]
|
|
3503
|
+
if 1 < len(args):
|
|
3504
|
+
self.Error = args[1]
|
|
3505
|
+
if "Error" in kwargs:
|
|
3506
|
+
self.Error = kwargs["Error"]
|
|
3507
|
+
if 2 < len(args):
|
|
3508
|
+
self.ChannelID = args[2]
|
|
3509
|
+
if "ChannelID" in kwargs:
|
|
3510
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
3511
|
+
if 3 < len(args):
|
|
3512
|
+
self.ConnectorToken = args[3]
|
|
3513
|
+
if "ConnectorToken" in kwargs:
|
|
3514
|
+
self.ConnectorToken = kwargs["ConnectorToken"]
|
|
3681
3515
|
def __del__(self):
|
|
3682
3516
|
_linksockslib.DecRef(self.handle)
|
|
3683
3517
|
def __str__(self):
|
|
3684
3518
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3685
|
-
sv = 'linksocks.
|
|
3519
|
+
sv = 'linksocks.ConnectorResponseMessage{'
|
|
3686
3520
|
first = True
|
|
3687
3521
|
for v in pr:
|
|
3688
3522
|
if callable(v[1]):
|
|
@@ -3695,109 +3529,44 @@ class WSConn(go.GoClass):
|
|
|
3695
3529
|
return sv + '}'
|
|
3696
3530
|
def __repr__(self):
|
|
3697
3531
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
3698
|
-
sv = 'linksocks.
|
|
3532
|
+
sv = 'linksocks.ConnectorResponseMessage ( '
|
|
3699
3533
|
for v in pr:
|
|
3700
3534
|
if not callable(v[1]):
|
|
3701
3535
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
3702
3536
|
return sv + ')'
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
return _linksockslib.
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
"""
|
|
3711
|
-
return _linksockslib.linksocks_WSConn_GetClientIP(self.handle)
|
|
3712
|
-
def SetClientIPFromRequest(self, r, goRun=False):
|
|
3713
|
-
"""SetClientIPFromRequest(object r)
|
|
3714
|
-
|
|
3715
|
-
SetClientIPFromRequest extracts and sets the client IP from HTTP request
|
|
3716
|
-
"""
|
|
3717
|
-
_linksockslib.linksocks_WSConn_SetClientIPFromRequest(self.handle, r.handle, goRun)
|
|
3718
|
-
def SyncWriteBinary(self, data):
|
|
3719
|
-
"""SyncWriteBinary([]int data) str
|
|
3720
|
-
|
|
3721
|
-
SyncWriteBinary performs thread-safe binary writes to the websocket connection
|
|
3722
|
-
"""
|
|
3723
|
-
return _linksockslib.linksocks_WSConn_SyncWriteBinary(self.handle, data.handle)
|
|
3724
|
-
def ReadMessage(self):
|
|
3725
|
-
"""ReadMessage() object, str
|
|
3726
|
-
|
|
3727
|
-
ReadMessage reads a BaseMessage from the websocket connection
|
|
3728
|
-
"""
|
|
3729
|
-
return BaseMessage(handle=_linksockslib.linksocks_WSConn_ReadMessage(self.handle))
|
|
3730
|
-
def WriteMessage(self, msg):
|
|
3731
|
-
"""WriteMessage(object msg) str
|
|
3732
|
-
|
|
3733
|
-
WriteMessage writes a BaseMessage to the websocket connection
|
|
3734
|
-
"""
|
|
3735
|
-
return _linksockslib.linksocks_WSConn_WriteMessage(self.handle, msg.handle)
|
|
3736
|
-
def SyncWriteControl(self, messageType, data, deadline):
|
|
3737
|
-
"""SyncWriteControl(int messageType, []int data, object deadline) str
|
|
3738
|
-
|
|
3739
|
-
SyncWriteControl performs thread-safe control message writes and tracks ping time
|
|
3740
|
-
"""
|
|
3741
|
-
return _linksockslib.linksocks_WSConn_SyncWriteControl(self.handle, messageType, data.handle, deadline.handle)
|
|
3742
|
-
def Close(self):
|
|
3743
|
-
"""Close() str
|
|
3744
|
-
|
|
3745
|
-
Close closes the underlying websocket connection
|
|
3746
|
-
"""
|
|
3747
|
-
return _linksockslib.linksocks_WSConn_Close(self.handle)
|
|
3748
|
-
|
|
3749
|
-
# Python type for struct linksocks.ContextWithCancel
|
|
3750
|
-
class ContextWithCancel(go.GoClass):
|
|
3751
|
-
"""ContextWithCancel wraps context and cancel function for Python bindings\n"""
|
|
3752
|
-
def __init__(self, *args, **kwargs):
|
|
3753
|
-
"""
|
|
3754
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
3755
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
3756
|
-
in which case a new Go object is constructed first
|
|
3757
|
-
"""
|
|
3758
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
3759
|
-
self.handle = kwargs['handle']
|
|
3760
|
-
_linksockslib.IncRef(self.handle)
|
|
3761
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
3762
|
-
self.handle = args[0].handle
|
|
3763
|
-
_linksockslib.IncRef(self.handle)
|
|
3537
|
+
@property
|
|
3538
|
+
def Success(self):
|
|
3539
|
+
return _linksockslib.linksocks_ConnectorResponseMessage_Success_Get(self.handle)
|
|
3540
|
+
@Success.setter
|
|
3541
|
+
def Success(self, value):
|
|
3542
|
+
if isinstance(value, go.GoClass):
|
|
3543
|
+
_linksockslib.linksocks_ConnectorResponseMessage_Success_Set(self.handle, value.handle)
|
|
3764
3544
|
else:
|
|
3765
|
-
self.handle
|
|
3766
|
-
|
|
3767
|
-
def
|
|
3768
|
-
_linksockslib.
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
def
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
"""Cancel()
|
|
3791
|
-
|
|
3792
|
-
Cancel calls the cancel function to cancel the context
|
|
3793
|
-
"""
|
|
3794
|
-
_linksockslib.linksocks_ContextWithCancel_Cancel(self.handle, goRun)
|
|
3795
|
-
def Context(self):
|
|
3796
|
-
"""Context() object
|
|
3797
|
-
|
|
3798
|
-
Context returns the underlying context.Context
|
|
3799
|
-
"""
|
|
3800
|
-
return go.context_Context(handle=_linksockslib.linksocks_ContextWithCancel_Context(self.handle))
|
|
3545
|
+
_linksockslib.linksocks_ConnectorResponseMessage_Success_Set(self.handle, value)
|
|
3546
|
+
@property
|
|
3547
|
+
def Error(self):
|
|
3548
|
+
return _linksockslib.linksocks_ConnectorResponseMessage_Error_Get(self.handle)
|
|
3549
|
+
@Error.setter
|
|
3550
|
+
def Error(self, value):
|
|
3551
|
+
if isinstance(value, go.GoClass):
|
|
3552
|
+
_linksockslib.linksocks_ConnectorResponseMessage_Error_Set(self.handle, value.handle)
|
|
3553
|
+
else:
|
|
3554
|
+
_linksockslib.linksocks_ConnectorResponseMessage_Error_Set(self.handle, value)
|
|
3555
|
+
@property
|
|
3556
|
+
def ChannelID(self):
|
|
3557
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_ConnectorResponseMessage_ChannelID_Get(self.handle))
|
|
3558
|
+
@property
|
|
3559
|
+
def ConnectorToken(self):
|
|
3560
|
+
return _linksockslib.linksocks_ConnectorResponseMessage_ConnectorToken_Get(self.handle)
|
|
3561
|
+
@ConnectorToken.setter
|
|
3562
|
+
def ConnectorToken(self, value):
|
|
3563
|
+
if isinstance(value, go.GoClass):
|
|
3564
|
+
_linksockslib.linksocks_ConnectorResponseMessage_ConnectorToken_Set(self.handle, value.handle)
|
|
3565
|
+
else:
|
|
3566
|
+
_linksockslib.linksocks_ConnectorResponseMessage_ConnectorToken_Set(self.handle, value)
|
|
3567
|
+
def GetType(self):
|
|
3568
|
+
"""GetType() str"""
|
|
3569
|
+
return _linksockslib.linksocks_ConnectorResponseMessage_GetType(self.handle)
|
|
3801
3570
|
|
|
3802
3571
|
# Python type for struct linksocks.PortPool
|
|
3803
3572
|
class PortPool(go.GoClass):
|
|
@@ -3960,9 +3729,9 @@ class Relay(go.GoClass):
|
|
|
3960
3729
|
"""
|
|
3961
3730
|
_linksockslib.linksocks_Relay_SetConnectionSuccess(self.handle, channelID.handle, goRun)
|
|
3962
3731
|
|
|
3963
|
-
# Python type for struct linksocks.
|
|
3964
|
-
class
|
|
3965
|
-
"""
|
|
3732
|
+
# Python type for struct linksocks.TokenStatus
|
|
3733
|
+
class TokenStatus(go.GoClass):
|
|
3734
|
+
"""TokenStatus represents the status of a token\n"""
|
|
3966
3735
|
def __init__(self, *args, **kwargs):
|
|
3967
3736
|
"""
|
|
3968
3737
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -3976,65 +3745,25 @@ class RelayOption(go.GoClass):
|
|
|
3976
3745
|
self.handle = args[0].handle
|
|
3977
3746
|
_linksockslib.IncRef(self.handle)
|
|
3978
3747
|
else:
|
|
3979
|
-
self.handle = _linksockslib.
|
|
3748
|
+
self.handle = _linksockslib.linksocks_TokenStatus_CTor()
|
|
3980
3749
|
_linksockslib.IncRef(self.handle)
|
|
3981
3750
|
if 0 < len(args):
|
|
3982
|
-
self.
|
|
3983
|
-
if "
|
|
3984
|
-
self.
|
|
3751
|
+
self.Token = args[0]
|
|
3752
|
+
if "Token" in kwargs:
|
|
3753
|
+
self.Token = kwargs["Token"]
|
|
3985
3754
|
if 1 < len(args):
|
|
3986
|
-
self.
|
|
3987
|
-
if "
|
|
3988
|
-
self.
|
|
3755
|
+
self.Type = args[1]
|
|
3756
|
+
if "Type" in kwargs:
|
|
3757
|
+
self.Type = kwargs["Type"]
|
|
3989
3758
|
if 2 < len(args):
|
|
3990
|
-
self.
|
|
3991
|
-
if "
|
|
3992
|
-
self.
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
if "FastOpen" in kwargs:
|
|
3996
|
-
self.FastOpen = kwargs["FastOpen"]
|
|
3997
|
-
if 4 < len(args):
|
|
3998
|
-
self.UpstreamProxy = args[4]
|
|
3999
|
-
if "UpstreamProxy" in kwargs:
|
|
4000
|
-
self.UpstreamProxy = kwargs["UpstreamProxy"]
|
|
4001
|
-
if 5 < len(args):
|
|
4002
|
-
self.UpstreamUsername = args[5]
|
|
4003
|
-
if "UpstreamUsername" in kwargs:
|
|
4004
|
-
self.UpstreamUsername = kwargs["UpstreamUsername"]
|
|
4005
|
-
if 6 < len(args):
|
|
4006
|
-
self.UpstreamPassword = args[6]
|
|
4007
|
-
if "UpstreamPassword" in kwargs:
|
|
4008
|
-
self.UpstreamPassword = kwargs["UpstreamPassword"]
|
|
4009
|
-
if 7 < len(args):
|
|
4010
|
-
self.EnableDynamicBatching = args[7]
|
|
4011
|
-
if "EnableDynamicBatching" in kwargs:
|
|
4012
|
-
self.EnableDynamicBatching = kwargs["EnableDynamicBatching"]
|
|
4013
|
-
if 8 < len(args):
|
|
4014
|
-
self.MaxBatchWaitTime = args[8]
|
|
4015
|
-
if "MaxBatchWaitTime" in kwargs:
|
|
4016
|
-
self.MaxBatchWaitTime = kwargs["MaxBatchWaitTime"]
|
|
4017
|
-
if 9 < len(args):
|
|
4018
|
-
self.MinBatchWaitTime = args[9]
|
|
4019
|
-
if "MinBatchWaitTime" in kwargs:
|
|
4020
|
-
self.MinBatchWaitTime = kwargs["MinBatchWaitTime"]
|
|
4021
|
-
if 10 < len(args):
|
|
4022
|
-
self.HighSpeedThreshold = args[10]
|
|
4023
|
-
if "HighSpeedThreshold" in kwargs:
|
|
4024
|
-
self.HighSpeedThreshold = kwargs["HighSpeedThreshold"]
|
|
4025
|
-
if 11 < len(args):
|
|
4026
|
-
self.LowSpeedThreshold = args[11]
|
|
4027
|
-
if "LowSpeedThreshold" in kwargs:
|
|
4028
|
-
self.LowSpeedThreshold = kwargs["LowSpeedThreshold"]
|
|
4029
|
-
if 12 < len(args):
|
|
4030
|
-
self.CompressionThreshold = args[12]
|
|
4031
|
-
if "CompressionThreshold" in kwargs:
|
|
4032
|
-
self.CompressionThreshold = kwargs["CompressionThreshold"]
|
|
4033
|
-
def __del__(self):
|
|
4034
|
-
_linksockslib.DecRef(self.handle)
|
|
3759
|
+
self.ClientsCount = args[2]
|
|
3760
|
+
if "ClientsCount" in kwargs:
|
|
3761
|
+
self.ClientsCount = kwargs["ClientsCount"]
|
|
3762
|
+
def __del__(self):
|
|
3763
|
+
_linksockslib.DecRef(self.handle)
|
|
4035
3764
|
def __str__(self):
|
|
4036
3765
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4037
|
-
sv = 'linksocks.
|
|
3766
|
+
sv = 'linksocks.TokenStatus{'
|
|
4038
3767
|
first = True
|
|
4039
3768
|
for v in pr:
|
|
4040
3769
|
if callable(v[1]):
|
|
@@ -4047,214 +3776,42 @@ class RelayOption(go.GoClass):
|
|
|
4047
3776
|
return sv + '}'
|
|
4048
3777
|
def __repr__(self):
|
|
4049
3778
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4050
|
-
sv = 'linksocks.
|
|
3779
|
+
sv = 'linksocks.TokenStatus ( '
|
|
4051
3780
|
for v in pr:
|
|
4052
3781
|
if not callable(v[1]):
|
|
4053
3782
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4054
3783
|
return sv + ')'
|
|
4055
3784
|
@property
|
|
4056
|
-
def
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
return _linksockslib.linksocks_RelayOption_BufferSize_Get(self.handle)
|
|
4061
|
-
@BufferSize.setter
|
|
4062
|
-
def BufferSize(self, value):
|
|
4063
|
-
if isinstance(value, go.GoClass):
|
|
4064
|
-
_linksockslib.linksocks_RelayOption_BufferSize_Set(self.handle, value.handle)
|
|
4065
|
-
else:
|
|
4066
|
-
_linksockslib.linksocks_RelayOption_BufferSize_Set(self.handle, value)
|
|
4067
|
-
@property
|
|
4068
|
-
def ChannelTimeout(self):
|
|
4069
|
-
return _linksockslib.linksocks_RelayOption_ChannelTimeout_Get(self.handle)
|
|
4070
|
-
@ChannelTimeout.setter
|
|
4071
|
-
def ChannelTimeout(self, value):
|
|
4072
|
-
if isinstance(value, go.GoClass):
|
|
4073
|
-
_linksockslib.linksocks_RelayOption_ChannelTimeout_Set(self.handle, value.handle)
|
|
4074
|
-
else:
|
|
4075
|
-
_linksockslib.linksocks_RelayOption_ChannelTimeout_Set(self.handle, value)
|
|
4076
|
-
@property
|
|
4077
|
-
def ConnectTimeout(self):
|
|
4078
|
-
return _linksockslib.linksocks_RelayOption_ConnectTimeout_Get(self.handle)
|
|
4079
|
-
@ConnectTimeout.setter
|
|
4080
|
-
def ConnectTimeout(self, value):
|
|
4081
|
-
if isinstance(value, go.GoClass):
|
|
4082
|
-
_linksockslib.linksocks_RelayOption_ConnectTimeout_Set(self.handle, value.handle)
|
|
4083
|
-
else:
|
|
4084
|
-
_linksockslib.linksocks_RelayOption_ConnectTimeout_Set(self.handle, value)
|
|
4085
|
-
@property
|
|
4086
|
-
def FastOpen(self):
|
|
4087
|
-
"""FastOpen controls whether to wait for connect success response
|
|
4088
|
-
When false, assumes connection success immediately
|
|
4089
|
-
"""
|
|
4090
|
-
return _linksockslib.linksocks_RelayOption_FastOpen_Get(self.handle)
|
|
4091
|
-
@FastOpen.setter
|
|
4092
|
-
def FastOpen(self, value):
|
|
4093
|
-
if isinstance(value, go.GoClass):
|
|
4094
|
-
_linksockslib.linksocks_RelayOption_FastOpen_Set(self.handle, value.handle)
|
|
4095
|
-
else:
|
|
4096
|
-
_linksockslib.linksocks_RelayOption_FastOpen_Set(self.handle, value)
|
|
4097
|
-
@property
|
|
4098
|
-
def UpstreamProxy(self):
|
|
4099
|
-
"""Upstream SOCKS5 proxy configuration
|
|
4100
|
-
"""
|
|
4101
|
-
return _linksockslib.linksocks_RelayOption_UpstreamProxy_Get(self.handle)
|
|
4102
|
-
@UpstreamProxy.setter
|
|
4103
|
-
def UpstreamProxy(self, value):
|
|
4104
|
-
if isinstance(value, go.GoClass):
|
|
4105
|
-
_linksockslib.linksocks_RelayOption_UpstreamProxy_Set(self.handle, value.handle)
|
|
4106
|
-
else:
|
|
4107
|
-
_linksockslib.linksocks_RelayOption_UpstreamProxy_Set(self.handle, value)
|
|
4108
|
-
@property
|
|
4109
|
-
def UpstreamUsername(self):
|
|
4110
|
-
return _linksockslib.linksocks_RelayOption_UpstreamUsername_Get(self.handle)
|
|
4111
|
-
@UpstreamUsername.setter
|
|
4112
|
-
def UpstreamUsername(self, value):
|
|
4113
|
-
if isinstance(value, go.GoClass):
|
|
4114
|
-
_linksockslib.linksocks_RelayOption_UpstreamUsername_Set(self.handle, value.handle)
|
|
4115
|
-
else:
|
|
4116
|
-
_linksockslib.linksocks_RelayOption_UpstreamUsername_Set(self.handle, value)
|
|
4117
|
-
@property
|
|
4118
|
-
def UpstreamPassword(self):
|
|
4119
|
-
return _linksockslib.linksocks_RelayOption_UpstreamPassword_Get(self.handle)
|
|
4120
|
-
@UpstreamPassword.setter
|
|
4121
|
-
def UpstreamPassword(self, value):
|
|
4122
|
-
if isinstance(value, go.GoClass):
|
|
4123
|
-
_linksockslib.linksocks_RelayOption_UpstreamPassword_Set(self.handle, value.handle)
|
|
4124
|
-
else:
|
|
4125
|
-
_linksockslib.linksocks_RelayOption_UpstreamPassword_Set(self.handle, value)
|
|
4126
|
-
@property
|
|
4127
|
-
def EnableDynamicBatching(self):
|
|
4128
|
-
"""Adaptive batching configuration
|
|
4129
|
-
"""
|
|
4130
|
-
return _linksockslib.linksocks_RelayOption_EnableDynamicBatching_Get(self.handle)
|
|
4131
|
-
@EnableDynamicBatching.setter
|
|
4132
|
-
def EnableDynamicBatching(self, value):
|
|
4133
|
-
if isinstance(value, go.GoClass):
|
|
4134
|
-
_linksockslib.linksocks_RelayOption_EnableDynamicBatching_Set(self.handle, value.handle)
|
|
4135
|
-
else:
|
|
4136
|
-
_linksockslib.linksocks_RelayOption_EnableDynamicBatching_Set(self.handle, value)
|
|
4137
|
-
@property
|
|
4138
|
-
def MaxBatchWaitTime(self):
|
|
4139
|
-
return _linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Get(self.handle)
|
|
4140
|
-
@MaxBatchWaitTime.setter
|
|
4141
|
-
def MaxBatchWaitTime(self, value):
|
|
4142
|
-
if isinstance(value, go.GoClass):
|
|
4143
|
-
_linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Set(self.handle, value.handle)
|
|
4144
|
-
else:
|
|
4145
|
-
_linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Set(self.handle, value)
|
|
4146
|
-
@property
|
|
4147
|
-
def MinBatchWaitTime(self):
|
|
4148
|
-
return _linksockslib.linksocks_RelayOption_MinBatchWaitTime_Get(self.handle)
|
|
4149
|
-
@MinBatchWaitTime.setter
|
|
4150
|
-
def MinBatchWaitTime(self, value):
|
|
4151
|
-
if isinstance(value, go.GoClass):
|
|
4152
|
-
_linksockslib.linksocks_RelayOption_MinBatchWaitTime_Set(self.handle, value.handle)
|
|
4153
|
-
else:
|
|
4154
|
-
_linksockslib.linksocks_RelayOption_MinBatchWaitTime_Set(self.handle, value)
|
|
4155
|
-
@property
|
|
4156
|
-
def HighSpeedThreshold(self):
|
|
4157
|
-
"""HighSpeedThreshold defines the bytes/sec rate above which batch delay increases
|
|
4158
|
-
"""
|
|
4159
|
-
return _linksockslib.linksocks_RelayOption_HighSpeedThreshold_Get(self.handle)
|
|
4160
|
-
@HighSpeedThreshold.setter
|
|
4161
|
-
def HighSpeedThreshold(self, value):
|
|
3785
|
+
def Token(self):
|
|
3786
|
+
return _linksockslib.linksocks_TokenStatus_Token_Get(self.handle)
|
|
3787
|
+
@Token.setter
|
|
3788
|
+
def Token(self, value):
|
|
4162
3789
|
if isinstance(value, go.GoClass):
|
|
4163
|
-
_linksockslib.
|
|
3790
|
+
_linksockslib.linksocks_TokenStatus_Token_Set(self.handle, value.handle)
|
|
4164
3791
|
else:
|
|
4165
|
-
_linksockslib.
|
|
3792
|
+
_linksockslib.linksocks_TokenStatus_Token_Set(self.handle, value)
|
|
4166
3793
|
@property
|
|
4167
|
-
def
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
@LowSpeedThreshold.setter
|
|
4172
|
-
def LowSpeedThreshold(self, value):
|
|
3794
|
+
def Type(self):
|
|
3795
|
+
return _linksockslib.linksocks_TokenStatus_Type_Get(self.handle)
|
|
3796
|
+
@Type.setter
|
|
3797
|
+
def Type(self, value):
|
|
4173
3798
|
if isinstance(value, go.GoClass):
|
|
4174
|
-
_linksockslib.
|
|
3799
|
+
_linksockslib.linksocks_TokenStatus_Type_Set(self.handle, value.handle)
|
|
4175
3800
|
else:
|
|
4176
|
-
_linksockslib.
|
|
3801
|
+
_linksockslib.linksocks_TokenStatus_Type_Set(self.handle, value)
|
|
4177
3802
|
@property
|
|
4178
|
-
def
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
@CompressionThreshold.setter
|
|
4183
|
-
def CompressionThreshold(self, value):
|
|
3803
|
+
def ClientsCount(self):
|
|
3804
|
+
return _linksockslib.linksocks_TokenStatus_ClientsCount_Get(self.handle)
|
|
3805
|
+
@ClientsCount.setter
|
|
3806
|
+
def ClientsCount(self, value):
|
|
4184
3807
|
if isinstance(value, go.GoClass):
|
|
4185
|
-
_linksockslib.
|
|
3808
|
+
_linksockslib.linksocks_TokenStatus_ClientsCount_Set(self.handle, value.handle)
|
|
4186
3809
|
else:
|
|
4187
|
-
_linksockslib.
|
|
4188
|
-
def WithBufferSize(self, size):
|
|
4189
|
-
"""WithBufferSize(int size) object
|
|
4190
|
-
|
|
4191
|
-
WithBufferSize sets the buffer size for the relay
|
|
4192
|
-
"""
|
|
4193
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithBufferSize(self.handle, size))
|
|
4194
|
-
def WithChannelTimeout(self, timeout):
|
|
4195
|
-
"""WithChannelTimeout(long timeout) object
|
|
4196
|
-
|
|
4197
|
-
WithChannelTimeout sets the channel timeout for the relay
|
|
4198
|
-
"""
|
|
4199
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithChannelTimeout(self.handle, timeout))
|
|
4200
|
-
def WithConnectTimeout(self, timeout):
|
|
4201
|
-
"""WithConnectTimeout(long timeout) object
|
|
4202
|
-
|
|
4203
|
-
WithConnectTimeout sets the connect timeout for the relay
|
|
4204
|
-
"""
|
|
4205
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithConnectTimeout(self.handle, timeout))
|
|
4206
|
-
def WithFastOpen(self, fastOpen):
|
|
4207
|
-
"""WithFastOpen(bool fastOpen) object
|
|
4208
|
-
|
|
4209
|
-
WithFastOpen sets the fast open mode for the relay
|
|
4210
|
-
"""
|
|
4211
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithFastOpen(self.handle, fastOpen))
|
|
4212
|
-
def WithUpstreamProxy(self, proxy):
|
|
4213
|
-
"""WithUpstreamProxy(str proxy) object
|
|
4214
|
-
|
|
4215
|
-
WithUpstreamProxy sets the upstream SOCKS5 proxy
|
|
4216
|
-
"""
|
|
4217
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithUpstreamProxy(self.handle, proxy))
|
|
4218
|
-
def WithUpstreamAuth(self, username, password):
|
|
4219
|
-
"""WithUpstreamAuth(str username, str password) object
|
|
4220
|
-
|
|
4221
|
-
WithUpstreamAuth sets the upstream SOCKS5 proxy authentication
|
|
4222
|
-
"""
|
|
4223
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithUpstreamAuth(self.handle, username, password))
|
|
4224
|
-
def WithDynamicBatching(self, enabled):
|
|
4225
|
-
"""WithDynamicBatching(bool enabled) object
|
|
4226
|
-
|
|
4227
|
-
WithDynamicBatching enables or disables adaptive batching for SOCKS TCP
|
|
4228
|
-
"""
|
|
4229
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithDynamicBatching(self.handle, enabled))
|
|
4230
|
-
def WithBatchingTimeLimits(self, min, max):
|
|
4231
|
-
"""WithBatchingTimeLimits(long min, long max) object
|
|
4232
|
-
|
|
4233
|
-
WithBatchingTimeLimits sets the min/max wait times for SOCKS TCP batching
|
|
4234
|
-
"""
|
|
4235
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithBatchingTimeLimits(self.handle, min, max))
|
|
4236
|
-
def WithHighSpeedThreshold(self, threshold):
|
|
4237
|
-
"""WithHighSpeedThreshold(float threshold) object
|
|
4238
|
-
|
|
4239
|
-
WithHighSpeedThreshold sets the threshold for increasing batch delay
|
|
4240
|
-
"""
|
|
4241
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithHighSpeedThreshold(self.handle, threshold))
|
|
4242
|
-
def WithLowSpeedThreshold(self, threshold):
|
|
4243
|
-
"""WithLowSpeedThreshold(float threshold) object
|
|
4244
|
-
|
|
4245
|
-
WithLowSpeedThreshold sets the threshold for reverting to immediate send
|
|
4246
|
-
"""
|
|
4247
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithLowSpeedThreshold(self.handle, threshold))
|
|
4248
|
-
def WithCompressionThreshold(self, threshold):
|
|
4249
|
-
"""WithCompressionThreshold(int threshold) object
|
|
4250
|
-
|
|
4251
|
-
WithCompressionThreshold sets the threshold for enabling data compression
|
|
4252
|
-
"""
|
|
4253
|
-
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithCompressionThreshold(self.handle, threshold))
|
|
3810
|
+
_linksockslib.linksocks_TokenStatus_ClientsCount_Set(self.handle, value)
|
|
4254
3811
|
|
|
4255
|
-
# Python type for struct linksocks.
|
|
4256
|
-
class
|
|
4257
|
-
"""
|
|
3812
|
+
# Python type for struct linksocks.WSConn
|
|
3813
|
+
class WSConn(go.GoClass):
|
|
3814
|
+
"""WSConn wraps a websocket.Conn with mutex protection\n"""
|
|
4258
3815
|
def __init__(self, *args, **kwargs):
|
|
4259
3816
|
"""
|
|
4260
3817
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4268,13 +3825,13 @@ class LinkSocksServer(go.GoClass):
|
|
|
4268
3825
|
self.handle = args[0].handle
|
|
4269
3826
|
_linksockslib.IncRef(self.handle)
|
|
4270
3827
|
else:
|
|
4271
|
-
self.handle = _linksockslib.
|
|
3828
|
+
self.handle = _linksockslib.linksocks_WSConn_CTor()
|
|
4272
3829
|
_linksockslib.IncRef(self.handle)
|
|
4273
3830
|
def __del__(self):
|
|
4274
3831
|
_linksockslib.DecRef(self.handle)
|
|
4275
3832
|
def __str__(self):
|
|
4276
3833
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4277
|
-
sv = 'linksocks.
|
|
3834
|
+
sv = 'linksocks.WSConn{'
|
|
4278
3835
|
first = True
|
|
4279
3836
|
for v in pr:
|
|
4280
3837
|
if callable(v[1]):
|
|
@@ -4287,75 +3844,60 @@ class LinkSocksServer(go.GoClass):
|
|
|
4287
3844
|
return sv + '}'
|
|
4288
3845
|
def __repr__(self):
|
|
4289
3846
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4290
|
-
sv = 'linksocks.
|
|
3847
|
+
sv = 'linksocks.WSConn ( '
|
|
4291
3848
|
for v in pr:
|
|
4292
3849
|
if not callable(v[1]):
|
|
4293
3850
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4294
3851
|
return sv + ')'
|
|
4295
|
-
def
|
|
4296
|
-
"""
|
|
3852
|
+
def Label(self):
|
|
3853
|
+
"""Label() str"""
|
|
3854
|
+
return _linksockslib.linksocks_WSConn_Label(self.handle)
|
|
3855
|
+
def GetClientIP(self):
|
|
3856
|
+
"""GetClientIP() str
|
|
4297
3857
|
|
|
4298
|
-
|
|
3858
|
+
GetClientIP returns the client IP address
|
|
4299
3859
|
"""
|
|
4300
|
-
return
|
|
4301
|
-
def
|
|
4302
|
-
"""
|
|
3860
|
+
return _linksockslib.linksocks_WSConn_GetClientIP(self.handle)
|
|
3861
|
+
def SetClientIPFromRequest(self, r, goRun=False):
|
|
3862
|
+
"""SetClientIPFromRequest(object r)
|
|
4303
3863
|
|
|
4304
|
-
|
|
3864
|
+
SetClientIPFromRequest extracts and sets the client IP from HTTP request
|
|
4305
3865
|
"""
|
|
4306
|
-
|
|
4307
|
-
def
|
|
4308
|
-
"""
|
|
3866
|
+
_linksockslib.linksocks_WSConn_SetClientIPFromRequest(self.handle, r.handle, goRun)
|
|
3867
|
+
def SyncWriteBinary(self, data):
|
|
3868
|
+
"""SyncWriteBinary([]int data) str
|
|
4309
3869
|
|
|
4310
|
-
|
|
3870
|
+
SyncWriteBinary performs thread-safe binary writes to the websocket connection
|
|
4311
3871
|
"""
|
|
4312
|
-
return _linksockslib.
|
|
4313
|
-
def
|
|
4314
|
-
"""
|
|
4315
|
-
|
|
4316
|
-
RemoveToken removes a token and disconnects all its clients
|
|
4317
|
-
"""
|
|
4318
|
-
return _linksockslib.linksocks_LinkSocksServer_RemoveToken(self.handle, token)
|
|
4319
|
-
def Serve(self, ctx):
|
|
4320
|
-
"""Serve(object ctx) str
|
|
4321
|
-
|
|
4322
|
-
Serve starts the WebSocket server and waits for clients
|
|
4323
|
-
"""
|
|
4324
|
-
return _linksockslib.linksocks_LinkSocksServer_Serve(self.handle, ctx.handle)
|
|
4325
|
-
def WaitReady(self, ctx, timeout):
|
|
4326
|
-
"""WaitReady(object ctx, long timeout) str
|
|
4327
|
-
|
|
4328
|
-
WaitReady starts the server and waits for the server to be ready with optional timeout
|
|
4329
|
-
"""
|
|
4330
|
-
return _linksockslib.linksocks_LinkSocksServer_WaitReady(self.handle, ctx.handle, timeout)
|
|
4331
|
-
def Close(self, goRun=False):
|
|
4332
|
-
"""Close()
|
|
3872
|
+
return _linksockslib.linksocks_WSConn_SyncWriteBinary(self.handle, data.handle)
|
|
3873
|
+
def ReadMessage(self):
|
|
3874
|
+
"""ReadMessage() object, str
|
|
4333
3875
|
|
|
4334
|
-
|
|
3876
|
+
ReadMessage reads a BaseMessage from the websocket connection
|
|
4335
3877
|
"""
|
|
4336
|
-
_linksockslib.
|
|
4337
|
-
def
|
|
4338
|
-
"""
|
|
3878
|
+
return BaseMessage(handle=_linksockslib.linksocks_WSConn_ReadMessage(self.handle))
|
|
3879
|
+
def WriteMessage(self, msg):
|
|
3880
|
+
"""WriteMessage(object msg) str
|
|
4339
3881
|
|
|
4340
|
-
|
|
3882
|
+
WriteMessage writes a BaseMessage to the websocket connection
|
|
4341
3883
|
"""
|
|
4342
|
-
return _linksockslib.
|
|
4343
|
-
def
|
|
4344
|
-
"""
|
|
3884
|
+
return _linksockslib.linksocks_WSConn_WriteMessage(self.handle, msg.handle)
|
|
3885
|
+
def SyncWriteControl(self, messageType, data, deadline):
|
|
3886
|
+
"""SyncWriteControl(int messageType, []int data, object deadline) str
|
|
4345
3887
|
|
|
4346
|
-
|
|
3888
|
+
SyncWriteControl performs thread-safe control message writes and tracks ping time
|
|
4347
3889
|
"""
|
|
4348
|
-
return _linksockslib.
|
|
4349
|
-
def
|
|
4350
|
-
"""
|
|
3890
|
+
return _linksockslib.linksocks_WSConn_SyncWriteControl(self.handle, messageType, data.handle, deadline.handle)
|
|
3891
|
+
def Close(self):
|
|
3892
|
+
"""Close() str
|
|
4351
3893
|
|
|
4352
|
-
|
|
3894
|
+
Close closes the underlying websocket connection
|
|
4353
3895
|
"""
|
|
4354
|
-
return _linksockslib.
|
|
3896
|
+
return _linksockslib.linksocks_WSConn_Close(self.handle)
|
|
4355
3897
|
|
|
4356
|
-
# Python type for struct linksocks.
|
|
4357
|
-
class
|
|
4358
|
-
"""
|
|
3898
|
+
# Python type for struct linksocks.CLI
|
|
3899
|
+
class CLI(go.GoClass):
|
|
3900
|
+
"""CLI represents the command-line interface for LinkSocks\n"""
|
|
4359
3901
|
def __init__(self, *args, **kwargs):
|
|
4360
3902
|
"""
|
|
4361
3903
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4369,21 +3911,13 @@ class StatusResponse(go.GoClass):
|
|
|
4369
3911
|
self.handle = args[0].handle
|
|
4370
3912
|
_linksockslib.IncRef(self.handle)
|
|
4371
3913
|
else:
|
|
4372
|
-
self.handle = _linksockslib.
|
|
3914
|
+
self.handle = _linksockslib.linksocks_CLI_CTor()
|
|
4373
3915
|
_linksockslib.IncRef(self.handle)
|
|
4374
|
-
if 0 < len(args):
|
|
4375
|
-
self.Version = args[0]
|
|
4376
|
-
if "Version" in kwargs:
|
|
4377
|
-
self.Version = kwargs["Version"]
|
|
4378
|
-
if 1 < len(args):
|
|
4379
|
-
self.Tokens = args[1]
|
|
4380
|
-
if "Tokens" in kwargs:
|
|
4381
|
-
self.Tokens = kwargs["Tokens"]
|
|
4382
3916
|
def __del__(self):
|
|
4383
3917
|
_linksockslib.DecRef(self.handle)
|
|
4384
3918
|
def __str__(self):
|
|
4385
3919
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4386
|
-
sv = 'linksocks.
|
|
3920
|
+
sv = 'linksocks.CLI{'
|
|
4387
3921
|
first = True
|
|
4388
3922
|
for v in pr:
|
|
4389
3923
|
if callable(v[1]):
|
|
@@ -4396,33 +3930,21 @@ class StatusResponse(go.GoClass):
|
|
|
4396
3930
|
return sv + '}'
|
|
4397
3931
|
def __repr__(self):
|
|
4398
3932
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4399
|
-
sv = 'linksocks.
|
|
3933
|
+
sv = 'linksocks.CLI ( '
|
|
4400
3934
|
for v in pr:
|
|
4401
3935
|
if not callable(v[1]):
|
|
4402
3936
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4403
3937
|
return sv + ')'
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
_linksockslib.linksocks_StatusResponse_Version_Set(self.handle, value.handle)
|
|
4411
|
-
else:
|
|
4412
|
-
_linksockslib.linksocks_StatusResponse_Version_Set(self.handle, value)
|
|
4413
|
-
@property
|
|
4414
|
-
def Tokens(self):
|
|
4415
|
-
return Slice_interface_(handle=_linksockslib.linksocks_StatusResponse_Tokens_Get(self.handle))
|
|
4416
|
-
@Tokens.setter
|
|
4417
|
-
def Tokens(self, value):
|
|
4418
|
-
if isinstance(value, go.GoClass):
|
|
4419
|
-
_linksockslib.linksocks_StatusResponse_Tokens_Set(self.handle, value.handle)
|
|
4420
|
-
else:
|
|
4421
|
-
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
3938
|
+
def Execute(self):
|
|
3939
|
+
"""Execute() str
|
|
3940
|
+
|
|
3941
|
+
Execute runs the CLI application
|
|
3942
|
+
"""
|
|
3943
|
+
return _linksockslib.linksocks_CLI_Execute(self.handle)
|
|
4422
3944
|
|
|
4423
|
-
# Python type for struct linksocks.
|
|
4424
|
-
class
|
|
4425
|
-
"""
|
|
3945
|
+
# Python type for struct linksocks.LinkSocksClient
|
|
3946
|
+
class LinkSocksClient(go.GoClass):
|
|
3947
|
+
"""LinkSocksClient represents a SOCKS5 over WebSocket protocol client\n"""
|
|
4426
3948
|
def __init__(self, *args, **kwargs):
|
|
4427
3949
|
"""
|
|
4428
3950
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4436,13 +3958,17 @@ class CLI(go.GoClass):
|
|
|
4436
3958
|
self.handle = args[0].handle
|
|
4437
3959
|
_linksockslib.IncRef(self.handle)
|
|
4438
3960
|
else:
|
|
4439
|
-
self.handle = _linksockslib.
|
|
3961
|
+
self.handle = _linksockslib.linksocks_LinkSocksClient_CTor()
|
|
4440
3962
|
_linksockslib.IncRef(self.handle)
|
|
3963
|
+
if 2 < len(args):
|
|
3964
|
+
self.IsConnected = args[2]
|
|
3965
|
+
if "IsConnected" in kwargs:
|
|
3966
|
+
self.IsConnected = kwargs["IsConnected"]
|
|
4441
3967
|
def __del__(self):
|
|
4442
3968
|
_linksockslib.DecRef(self.handle)
|
|
4443
3969
|
def __str__(self):
|
|
4444
3970
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4445
|
-
sv = 'linksocks.
|
|
3971
|
+
sv = 'linksocks.LinkSocksClient{'
|
|
4446
3972
|
first = True
|
|
4447
3973
|
for v in pr:
|
|
4448
3974
|
if callable(v[1]):
|
|
@@ -4455,21 +3981,62 @@ class CLI(go.GoClass):
|
|
|
4455
3981
|
return sv + '}'
|
|
4456
3982
|
def __repr__(self):
|
|
4457
3983
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4458
|
-
sv = 'linksocks.
|
|
3984
|
+
sv = 'linksocks.LinkSocksClient ( '
|
|
4459
3985
|
for v in pr:
|
|
4460
3986
|
if not callable(v[1]):
|
|
4461
3987
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4462
3988
|
return sv + ')'
|
|
4463
|
-
|
|
4464
|
-
|
|
3989
|
+
@property
|
|
3990
|
+
def IsConnected(self):
|
|
3991
|
+
return _linksockslib.linksocks_LinkSocksClient_IsConnected_Get(self.handle)
|
|
3992
|
+
@IsConnected.setter
|
|
3993
|
+
def IsConnected(self, value):
|
|
3994
|
+
if isinstance(value, go.GoClass):
|
|
3995
|
+
_linksockslib.linksocks_LinkSocksClient_IsConnected_Set(self.handle, value.handle)
|
|
3996
|
+
else:
|
|
3997
|
+
_linksockslib.linksocks_LinkSocksClient_IsConnected_Set(self.handle, value)
|
|
3998
|
+
def WaitReady(self, ctx, timeout):
|
|
3999
|
+
"""WaitReady(object ctx, long timeout) str
|
|
4465
4000
|
|
|
4466
|
-
|
|
4001
|
+
WaitReady start the client and waits for the client to be ready with optional timeout
|
|
4467
4002
|
"""
|
|
4468
|
-
return _linksockslib.
|
|
4003
|
+
return _linksockslib.linksocks_LinkSocksClient_WaitReady(self.handle, ctx.handle, timeout)
|
|
4004
|
+
def Connect(self, ctx):
|
|
4005
|
+
"""Connect(object ctx) str
|
|
4006
|
+
|
|
4007
|
+
Connect starts the client operation
|
|
4008
|
+
"""
|
|
4009
|
+
return _linksockslib.linksocks_LinkSocksClient_Connect(self.handle, ctx.handle)
|
|
4010
|
+
def Close(self, goRun=False):
|
|
4011
|
+
"""Close()
|
|
4012
|
+
|
|
4013
|
+
Close gracefully shuts down the LinkSocksClient
|
|
4014
|
+
"""
|
|
4015
|
+
_linksockslib.linksocks_LinkSocksClient_Close(self.handle, goRun)
|
|
4016
|
+
def AddConnector(self, connectorToken):
|
|
4017
|
+
"""AddConnector(str connectorToken) str, str
|
|
4018
|
+
|
|
4019
|
+
AddConnector sends a request to add a new connector token and waits for response.
|
|
4020
|
+
This function is only available in reverse proxy mode.
|
|
4021
|
+
"""
|
|
4022
|
+
return _linksockslib.linksocks_LinkSocksClient_AddConnector(self.handle, connectorToken)
|
|
4023
|
+
def RemoveConnector(self, connectorToken):
|
|
4024
|
+
"""RemoveConnector(str connectorToken) str
|
|
4025
|
+
|
|
4026
|
+
RemoveConnector sends a request to remove a connector token and waits for response.
|
|
4027
|
+
This function is only available in reverse proxy mode.
|
|
4028
|
+
"""
|
|
4029
|
+
return _linksockslib.linksocks_LinkSocksClient_RemoveConnector(self.handle, connectorToken)
|
|
4030
|
+
def GetPartnersCount(self):
|
|
4031
|
+
"""GetPartnersCount() int
|
|
4032
|
+
|
|
4033
|
+
GetPartnersCount returns the current number of partners
|
|
4034
|
+
"""
|
|
4035
|
+
return _linksockslib.linksocks_LinkSocksClient_GetPartnersCount(self.handle)
|
|
4469
4036
|
|
|
4470
|
-
# Python type for struct linksocks.
|
|
4471
|
-
class
|
|
4472
|
-
"""
|
|
4037
|
+
# Python type for struct linksocks.TokenRequest
|
|
4038
|
+
class TokenRequest(go.GoClass):
|
|
4039
|
+
"""TokenRequest represents a request to create a new token\n"""
|
|
4473
4040
|
def __init__(self, *args, **kwargs):
|
|
4474
4041
|
"""
|
|
4475
4042
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4483,29 +4050,41 @@ class ConnectMessage(go.GoClass):
|
|
|
4483
4050
|
self.handle = args[0].handle
|
|
4484
4051
|
_linksockslib.IncRef(self.handle)
|
|
4485
4052
|
else:
|
|
4486
|
-
self.handle = _linksockslib.
|
|
4053
|
+
self.handle = _linksockslib.linksocks_TokenRequest_CTor()
|
|
4487
4054
|
_linksockslib.IncRef(self.handle)
|
|
4488
4055
|
if 0 < len(args):
|
|
4489
|
-
self.
|
|
4490
|
-
if "
|
|
4491
|
-
self.
|
|
4056
|
+
self.Type = args[0]
|
|
4057
|
+
if "Type" in kwargs:
|
|
4058
|
+
self.Type = kwargs["Type"]
|
|
4492
4059
|
if 1 < len(args):
|
|
4493
|
-
self.
|
|
4494
|
-
if "
|
|
4495
|
-
self.
|
|
4060
|
+
self.Token = args[1]
|
|
4061
|
+
if "Token" in kwargs:
|
|
4062
|
+
self.Token = kwargs["Token"]
|
|
4496
4063
|
if 2 < len(args):
|
|
4497
4064
|
self.Port = args[2]
|
|
4498
4065
|
if "Port" in kwargs:
|
|
4499
4066
|
self.Port = kwargs["Port"]
|
|
4500
4067
|
if 3 < len(args):
|
|
4501
|
-
self.
|
|
4502
|
-
if "
|
|
4503
|
-
self.
|
|
4068
|
+
self.Username = args[3]
|
|
4069
|
+
if "Username" in kwargs:
|
|
4070
|
+
self.Username = kwargs["Username"]
|
|
4071
|
+
if 4 < len(args):
|
|
4072
|
+
self.Password = args[4]
|
|
4073
|
+
if "Password" in kwargs:
|
|
4074
|
+
self.Password = kwargs["Password"]
|
|
4075
|
+
if 5 < len(args):
|
|
4076
|
+
self.ReverseToken = args[5]
|
|
4077
|
+
if "ReverseToken" in kwargs:
|
|
4078
|
+
self.ReverseToken = kwargs["ReverseToken"]
|
|
4079
|
+
if 6 < len(args):
|
|
4080
|
+
self.AllowManageConnector = args[6]
|
|
4081
|
+
if "AllowManageConnector" in kwargs:
|
|
4082
|
+
self.AllowManageConnector = kwargs["AllowManageConnector"]
|
|
4504
4083
|
def __del__(self):
|
|
4505
4084
|
_linksockslib.DecRef(self.handle)
|
|
4506
4085
|
def __str__(self):
|
|
4507
4086
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4508
|
-
sv = 'linksocks.
|
|
4087
|
+
sv = 'linksocks.TokenRequest{'
|
|
4509
4088
|
first = True
|
|
4510
4089
|
for v in pr:
|
|
4511
4090
|
if callable(v[1]):
|
|
@@ -4518,80 +4097,157 @@ class ConnectMessage(go.GoClass):
|
|
|
4518
4097
|
return sv + '}'
|
|
4519
4098
|
def __repr__(self):
|
|
4520
4099
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4521
|
-
sv = 'linksocks.
|
|
4100
|
+
sv = 'linksocks.TokenRequest ( '
|
|
4522
4101
|
for v in pr:
|
|
4523
4102
|
if not callable(v[1]):
|
|
4524
4103
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4525
4104
|
return sv + ')'
|
|
4526
4105
|
@property
|
|
4527
|
-
def
|
|
4528
|
-
return _linksockslib.
|
|
4529
|
-
@
|
|
4530
|
-
def
|
|
4106
|
+
def Type(self):
|
|
4107
|
+
return _linksockslib.linksocks_TokenRequest_Type_Get(self.handle)
|
|
4108
|
+
@Type.setter
|
|
4109
|
+
def Type(self, value):
|
|
4531
4110
|
if isinstance(value, go.GoClass):
|
|
4532
|
-
_linksockslib.
|
|
4111
|
+
_linksockslib.linksocks_TokenRequest_Type_Set(self.handle, value.handle)
|
|
4533
4112
|
else:
|
|
4534
|
-
_linksockslib.
|
|
4113
|
+
_linksockslib.linksocks_TokenRequest_Type_Set(self.handle, value)
|
|
4535
4114
|
@property
|
|
4536
|
-
def
|
|
4537
|
-
return _linksockslib.
|
|
4538
|
-
@
|
|
4539
|
-
def
|
|
4115
|
+
def Token(self):
|
|
4116
|
+
return _linksockslib.linksocks_TokenRequest_Token_Get(self.handle)
|
|
4117
|
+
@Token.setter
|
|
4118
|
+
def Token(self, value):
|
|
4540
4119
|
if isinstance(value, go.GoClass):
|
|
4541
|
-
_linksockslib.
|
|
4120
|
+
_linksockslib.linksocks_TokenRequest_Token_Set(self.handle, value.handle)
|
|
4542
4121
|
else:
|
|
4543
|
-
_linksockslib.
|
|
4122
|
+
_linksockslib.linksocks_TokenRequest_Token_Set(self.handle, value)
|
|
4544
4123
|
@property
|
|
4545
4124
|
def Port(self):
|
|
4546
|
-
return _linksockslib.
|
|
4125
|
+
return _linksockslib.linksocks_TokenRequest_Port_Get(self.handle)
|
|
4547
4126
|
@Port.setter
|
|
4548
4127
|
def Port(self, value):
|
|
4549
4128
|
if isinstance(value, go.GoClass):
|
|
4550
|
-
_linksockslib.
|
|
4129
|
+
_linksockslib.linksocks_TokenRequest_Port_Set(self.handle, value.handle)
|
|
4551
4130
|
else:
|
|
4552
|
-
_linksockslib.
|
|
4131
|
+
_linksockslib.linksocks_TokenRequest_Port_Set(self.handle, value)
|
|
4553
4132
|
@property
|
|
4554
|
-
def
|
|
4555
|
-
return
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
def
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
self.handle
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
_linksockslib.
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4133
|
+
def Username(self):
|
|
4134
|
+
return _linksockslib.linksocks_TokenRequest_Username_Get(self.handle)
|
|
4135
|
+
@Username.setter
|
|
4136
|
+
def Username(self, value):
|
|
4137
|
+
if isinstance(value, go.GoClass):
|
|
4138
|
+
_linksockslib.linksocks_TokenRequest_Username_Set(self.handle, value.handle)
|
|
4139
|
+
else:
|
|
4140
|
+
_linksockslib.linksocks_TokenRequest_Username_Set(self.handle, value)
|
|
4141
|
+
@property
|
|
4142
|
+
def Password(self):
|
|
4143
|
+
return _linksockslib.linksocks_TokenRequest_Password_Get(self.handle)
|
|
4144
|
+
@Password.setter
|
|
4145
|
+
def Password(self, value):
|
|
4146
|
+
if isinstance(value, go.GoClass):
|
|
4147
|
+
_linksockslib.linksocks_TokenRequest_Password_Set(self.handle, value.handle)
|
|
4148
|
+
else:
|
|
4149
|
+
_linksockslib.linksocks_TokenRequest_Password_Set(self.handle, value)
|
|
4150
|
+
@property
|
|
4151
|
+
def ReverseToken(self):
|
|
4152
|
+
return _linksockslib.linksocks_TokenRequest_ReverseToken_Get(self.handle)
|
|
4153
|
+
@ReverseToken.setter
|
|
4154
|
+
def ReverseToken(self, value):
|
|
4155
|
+
if isinstance(value, go.GoClass):
|
|
4156
|
+
_linksockslib.linksocks_TokenRequest_ReverseToken_Set(self.handle, value.handle)
|
|
4157
|
+
else:
|
|
4158
|
+
_linksockslib.linksocks_TokenRequest_ReverseToken_Set(self.handle, value)
|
|
4159
|
+
@property
|
|
4160
|
+
def AllowManageConnector(self):
|
|
4161
|
+
return _linksockslib.linksocks_TokenRequest_AllowManageConnector_Get(self.handle)
|
|
4162
|
+
@AllowManageConnector.setter
|
|
4163
|
+
def AllowManageConnector(self, value):
|
|
4164
|
+
if isinstance(value, go.GoClass):
|
|
4165
|
+
_linksockslib.linksocks_TokenRequest_AllowManageConnector_Set(self.handle, value.handle)
|
|
4166
|
+
else:
|
|
4167
|
+
_linksockslib.linksocks_TokenRequest_AllowManageConnector_Set(self.handle, value)
|
|
4168
|
+
|
|
4169
|
+
# Python type for struct linksocks.APIHandler
|
|
4170
|
+
class APIHandler(go.GoClass):
|
|
4171
|
+
"""APIHandler handles HTTP API requests for LinkSocksServer\n"""
|
|
4172
|
+
def __init__(self, *args, **kwargs):
|
|
4173
|
+
"""
|
|
4174
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
4175
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
4176
|
+
in which case a new Go object is constructed first
|
|
4177
|
+
"""
|
|
4178
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
4179
|
+
self.handle = kwargs['handle']
|
|
4180
|
+
_linksockslib.IncRef(self.handle)
|
|
4181
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
4182
|
+
self.handle = args[0].handle
|
|
4183
|
+
_linksockslib.IncRef(self.handle)
|
|
4184
|
+
else:
|
|
4185
|
+
self.handle = _linksockslib.linksocks_APIHandler_CTor()
|
|
4186
|
+
_linksockslib.IncRef(self.handle)
|
|
4187
|
+
def __del__(self):
|
|
4188
|
+
_linksockslib.DecRef(self.handle)
|
|
4189
|
+
def __str__(self):
|
|
4190
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4191
|
+
sv = 'linksocks.APIHandler{'
|
|
4192
|
+
first = True
|
|
4193
|
+
for v in pr:
|
|
4194
|
+
if callable(v[1]):
|
|
4195
|
+
continue
|
|
4196
|
+
if first:
|
|
4197
|
+
first = False
|
|
4198
|
+
else:
|
|
4199
|
+
sv += ', '
|
|
4200
|
+
sv += v[0] + '=' + str(v[1])
|
|
4201
|
+
return sv + '}'
|
|
4202
|
+
def __repr__(self):
|
|
4203
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4204
|
+
sv = 'linksocks.APIHandler ( '
|
|
4205
|
+
for v in pr:
|
|
4206
|
+
if not callable(v[1]):
|
|
4207
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4208
|
+
return sv + ')'
|
|
4209
|
+
def RegisterHandlers(self, mux, goRun=False):
|
|
4210
|
+
"""RegisterHandlers(object mux)
|
|
4211
|
+
|
|
4212
|
+
RegisterHandlers registers API endpoints with the provided mux
|
|
4213
|
+
"""
|
|
4214
|
+
_linksockslib.linksocks_APIHandler_RegisterHandlers(self.handle, mux.handle, goRun)
|
|
4215
|
+
|
|
4216
|
+
# Python type for struct linksocks.ConnectResponseMessage
|
|
4217
|
+
class ConnectResponseMessage(go.GoClass):
|
|
4218
|
+
"""ConnectResponseMessage represents a connection response\n"""
|
|
4219
|
+
def __init__(self, *args, **kwargs):
|
|
4220
|
+
"""
|
|
4221
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
4222
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
4223
|
+
in which case a new Go object is constructed first
|
|
4224
|
+
"""
|
|
4225
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
4226
|
+
self.handle = kwargs['handle']
|
|
4227
|
+
_linksockslib.IncRef(self.handle)
|
|
4228
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
4229
|
+
self.handle = args[0].handle
|
|
4230
|
+
_linksockslib.IncRef(self.handle)
|
|
4231
|
+
else:
|
|
4232
|
+
self.handle = _linksockslib.linksocks_ConnectResponseMessage_CTor()
|
|
4233
|
+
_linksockslib.IncRef(self.handle)
|
|
4234
|
+
if 0 < len(args):
|
|
4235
|
+
self.Success = args[0]
|
|
4236
|
+
if "Success" in kwargs:
|
|
4237
|
+
self.Success = kwargs["Success"]
|
|
4582
4238
|
if 1 < len(args):
|
|
4583
|
-
self.
|
|
4584
|
-
if "
|
|
4585
|
-
self.
|
|
4239
|
+
self.Error = args[1]
|
|
4240
|
+
if "Error" in kwargs:
|
|
4241
|
+
self.Error = kwargs["Error"]
|
|
4586
4242
|
if 2 < len(args):
|
|
4587
|
-
self.
|
|
4588
|
-
if "
|
|
4589
|
-
self.
|
|
4243
|
+
self.ChannelID = args[2]
|
|
4244
|
+
if "ChannelID" in kwargs:
|
|
4245
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
4590
4246
|
def __del__(self):
|
|
4591
4247
|
_linksockslib.DecRef(self.handle)
|
|
4592
4248
|
def __str__(self):
|
|
4593
4249
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4594
|
-
sv = 'linksocks.
|
|
4250
|
+
sv = 'linksocks.ConnectResponseMessage{'
|
|
4595
4251
|
first = True
|
|
4596
4252
|
for v in pr:
|
|
4597
4253
|
if callable(v[1]):
|
|
@@ -4604,39 +4260,39 @@ class ConnectorMessage(go.GoClass):
|
|
|
4604
4260
|
return sv + '}'
|
|
4605
4261
|
def __repr__(self):
|
|
4606
4262
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4607
|
-
sv = 'linksocks.
|
|
4263
|
+
sv = 'linksocks.ConnectResponseMessage ( '
|
|
4608
4264
|
for v in pr:
|
|
4609
4265
|
if not callable(v[1]):
|
|
4610
4266
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4611
4267
|
return sv + ')'
|
|
4612
4268
|
@property
|
|
4613
|
-
def
|
|
4614
|
-
return
|
|
4615
|
-
@
|
|
4616
|
-
def
|
|
4617
|
-
return _linksockslib.linksocks_ConnectorMessage_ConnectorToken_Get(self.handle)
|
|
4618
|
-
@ConnectorToken.setter
|
|
4619
|
-
def ConnectorToken(self, value):
|
|
4269
|
+
def Success(self):
|
|
4270
|
+
return _linksockslib.linksocks_ConnectResponseMessage_Success_Get(self.handle)
|
|
4271
|
+
@Success.setter
|
|
4272
|
+
def Success(self, value):
|
|
4620
4273
|
if isinstance(value, go.GoClass):
|
|
4621
|
-
_linksockslib.
|
|
4274
|
+
_linksockslib.linksocks_ConnectResponseMessage_Success_Set(self.handle, value.handle)
|
|
4622
4275
|
else:
|
|
4623
|
-
_linksockslib.
|
|
4276
|
+
_linksockslib.linksocks_ConnectResponseMessage_Success_Set(self.handle, value)
|
|
4624
4277
|
@property
|
|
4625
|
-
def
|
|
4626
|
-
return _linksockslib.
|
|
4627
|
-
@
|
|
4628
|
-
def
|
|
4278
|
+
def Error(self):
|
|
4279
|
+
return _linksockslib.linksocks_ConnectResponseMessage_Error_Get(self.handle)
|
|
4280
|
+
@Error.setter
|
|
4281
|
+
def Error(self, value):
|
|
4629
4282
|
if isinstance(value, go.GoClass):
|
|
4630
|
-
_linksockslib.
|
|
4283
|
+
_linksockslib.linksocks_ConnectResponseMessage_Error_Set(self.handle, value.handle)
|
|
4631
4284
|
else:
|
|
4632
|
-
_linksockslib.
|
|
4285
|
+
_linksockslib.linksocks_ConnectResponseMessage_Error_Set(self.handle, value)
|
|
4286
|
+
@property
|
|
4287
|
+
def ChannelID(self):
|
|
4288
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_ConnectResponseMessage_ChannelID_Get(self.handle))
|
|
4633
4289
|
def GetType(self):
|
|
4634
4290
|
"""GetType() str"""
|
|
4635
|
-
return _linksockslib.
|
|
4291
|
+
return _linksockslib.linksocks_ConnectResponseMessage_GetType(self.handle)
|
|
4636
4292
|
|
|
4637
|
-
# Python type for struct linksocks.
|
|
4638
|
-
class
|
|
4639
|
-
"""
|
|
4293
|
+
# Python type for struct linksocks.PartnersMessage
|
|
4294
|
+
class PartnersMessage(go.GoClass):
|
|
4295
|
+
"""PartnersMessage represents a partners count update message\n"""
|
|
4640
4296
|
def __init__(self, *args, **kwargs):
|
|
4641
4297
|
"""
|
|
4642
4298
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4650,25 +4306,17 @@ class LogEntry(go.GoClass):
|
|
|
4650
4306
|
self.handle = args[0].handle
|
|
4651
4307
|
_linksockslib.IncRef(self.handle)
|
|
4652
4308
|
else:
|
|
4653
|
-
self.handle = _linksockslib.
|
|
4309
|
+
self.handle = _linksockslib.linksocks_PartnersMessage_CTor()
|
|
4654
4310
|
_linksockslib.IncRef(self.handle)
|
|
4655
4311
|
if 0 < len(args):
|
|
4656
|
-
self.
|
|
4657
|
-
if "
|
|
4658
|
-
self.
|
|
4659
|
-
if 1 < len(args):
|
|
4660
|
-
self.Message = args[1]
|
|
4661
|
-
if "Message" in kwargs:
|
|
4662
|
-
self.Message = kwargs["Message"]
|
|
4663
|
-
if 2 < len(args):
|
|
4664
|
-
self.Time = args[2]
|
|
4665
|
-
if "Time" in kwargs:
|
|
4666
|
-
self.Time = kwargs["Time"]
|
|
4312
|
+
self.Count = args[0]
|
|
4313
|
+
if "Count" in kwargs:
|
|
4314
|
+
self.Count = kwargs["Count"]
|
|
4667
4315
|
def __del__(self):
|
|
4668
4316
|
_linksockslib.DecRef(self.handle)
|
|
4669
4317
|
def __str__(self):
|
|
4670
4318
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4671
|
-
sv = 'linksocks.
|
|
4319
|
+
sv = 'linksocks.PartnersMessage{'
|
|
4672
4320
|
first = True
|
|
4673
4321
|
for v in pr:
|
|
4674
4322
|
if callable(v[1]):
|
|
@@ -4681,42 +4329,27 @@ class LogEntry(go.GoClass):
|
|
|
4681
4329
|
return sv + '}'
|
|
4682
4330
|
def __repr__(self):
|
|
4683
4331
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4684
|
-
sv = 'linksocks.
|
|
4332
|
+
sv = 'linksocks.PartnersMessage ( '
|
|
4685
4333
|
for v in pr:
|
|
4686
4334
|
if not callable(v[1]):
|
|
4687
4335
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4688
4336
|
return sv + ')'
|
|
4689
4337
|
@property
|
|
4690
|
-
def
|
|
4691
|
-
return _linksockslib.
|
|
4692
|
-
@
|
|
4693
|
-
def
|
|
4694
|
-
if isinstance(value, go.GoClass):
|
|
4695
|
-
_linksockslib.linksocks_LogEntry_LoggerID_Set(self.handle, value.handle)
|
|
4696
|
-
else:
|
|
4697
|
-
_linksockslib.linksocks_LogEntry_LoggerID_Set(self.handle, value)
|
|
4698
|
-
@property
|
|
4699
|
-
def Message(self):
|
|
4700
|
-
return _linksockslib.linksocks_LogEntry_Message_Get(self.handle)
|
|
4701
|
-
@Message.setter
|
|
4702
|
-
def Message(self, value):
|
|
4703
|
-
if isinstance(value, go.GoClass):
|
|
4704
|
-
_linksockslib.linksocks_LogEntry_Message_Set(self.handle, value.handle)
|
|
4705
|
-
else:
|
|
4706
|
-
_linksockslib.linksocks_LogEntry_Message_Set(self.handle, value)
|
|
4707
|
-
@property
|
|
4708
|
-
def Time(self):
|
|
4709
|
-
return _linksockslib.linksocks_LogEntry_Time_Get(self.handle)
|
|
4710
|
-
@Time.setter
|
|
4711
|
-
def Time(self, value):
|
|
4338
|
+
def Count(self):
|
|
4339
|
+
return _linksockslib.linksocks_PartnersMessage_Count_Get(self.handle)
|
|
4340
|
+
@Count.setter
|
|
4341
|
+
def Count(self, value):
|
|
4712
4342
|
if isinstance(value, go.GoClass):
|
|
4713
|
-
_linksockslib.
|
|
4343
|
+
_linksockslib.linksocks_PartnersMessage_Count_Set(self.handle, value.handle)
|
|
4714
4344
|
else:
|
|
4715
|
-
_linksockslib.
|
|
4345
|
+
_linksockslib.linksocks_PartnersMessage_Count_Set(self.handle, value)
|
|
4346
|
+
def GetType(self):
|
|
4347
|
+
"""GetType() str"""
|
|
4348
|
+
return _linksockslib.linksocks_PartnersMessage_GetType(self.handle)
|
|
4716
4349
|
|
|
4717
|
-
# Python type for struct linksocks.
|
|
4718
|
-
class
|
|
4719
|
-
"""
|
|
4350
|
+
# Python type for struct linksocks.ContextWithCancel
|
|
4351
|
+
class ContextWithCancel(go.GoClass):
|
|
4352
|
+
"""ContextWithCancel wraps context and cancel function for Python bindings\n"""
|
|
4720
4353
|
def __init__(self, *args, **kwargs):
|
|
4721
4354
|
"""
|
|
4722
4355
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4730,13 +4363,13 @@ class APIHandler(go.GoClass):
|
|
|
4730
4363
|
self.handle = args[0].handle
|
|
4731
4364
|
_linksockslib.IncRef(self.handle)
|
|
4732
4365
|
else:
|
|
4733
|
-
self.handle = _linksockslib.
|
|
4366
|
+
self.handle = _linksockslib.linksocks_ContextWithCancel_CTor()
|
|
4734
4367
|
_linksockslib.IncRef(self.handle)
|
|
4735
4368
|
def __del__(self):
|
|
4736
4369
|
_linksockslib.DecRef(self.handle)
|
|
4737
4370
|
def __str__(self):
|
|
4738
4371
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4739
|
-
sv = 'linksocks.
|
|
4372
|
+
sv = 'linksocks.ContextWithCancel{'
|
|
4740
4373
|
first = True
|
|
4741
4374
|
for v in pr:
|
|
4742
4375
|
if callable(v[1]):
|
|
@@ -4749,21 +4382,27 @@ class APIHandler(go.GoClass):
|
|
|
4749
4382
|
return sv + '}'
|
|
4750
4383
|
def __repr__(self):
|
|
4751
4384
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4752
|
-
sv = 'linksocks.
|
|
4385
|
+
sv = 'linksocks.ContextWithCancel ( '
|
|
4753
4386
|
for v in pr:
|
|
4754
4387
|
if not callable(v[1]):
|
|
4755
4388
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4756
4389
|
return sv + ')'
|
|
4757
|
-
def
|
|
4758
|
-
"""
|
|
4390
|
+
def Cancel(self, goRun=False):
|
|
4391
|
+
"""Cancel()
|
|
4759
4392
|
|
|
4760
|
-
|
|
4393
|
+
Cancel calls the cancel function to cancel the context
|
|
4761
4394
|
"""
|
|
4762
|
-
_linksockslib.
|
|
4395
|
+
_linksockslib.linksocks_ContextWithCancel_Cancel(self.handle, goRun)
|
|
4396
|
+
def Context(self):
|
|
4397
|
+
"""Context() object
|
|
4398
|
+
|
|
4399
|
+
Context returns the underlying context.Context
|
|
4400
|
+
"""
|
|
4401
|
+
return go.context_Context(handle=_linksockslib.linksocks_ContextWithCancel_Context(self.handle))
|
|
4763
4402
|
|
|
4764
|
-
# Python type for struct linksocks.
|
|
4765
|
-
class
|
|
4766
|
-
"""
|
|
4403
|
+
# Python type for struct linksocks.DisconnectMessage
|
|
4404
|
+
class DisconnectMessage(go.GoClass):
|
|
4405
|
+
"""DisconnectMessage represents a connection termination message\n"""
|
|
4767
4406
|
def __init__(self, *args, **kwargs):
|
|
4768
4407
|
"""
|
|
4769
4408
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -4777,14 +4416,238 @@ class ClientOption(go.GoClass):
|
|
|
4777
4416
|
self.handle = args[0].handle
|
|
4778
4417
|
_linksockslib.IncRef(self.handle)
|
|
4779
4418
|
else:
|
|
4780
|
-
self.handle = _linksockslib.
|
|
4419
|
+
self.handle = _linksockslib.linksocks_DisconnectMessage_CTor()
|
|
4781
4420
|
_linksockslib.IncRef(self.handle)
|
|
4782
4421
|
if 0 < len(args):
|
|
4783
|
-
self.
|
|
4784
|
-
if "
|
|
4785
|
-
self.
|
|
4422
|
+
self.ChannelID = args[0]
|
|
4423
|
+
if "ChannelID" in kwargs:
|
|
4424
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
4786
4425
|
if 1 < len(args):
|
|
4787
|
-
self.
|
|
4426
|
+
self.Error = args[1]
|
|
4427
|
+
if "Error" in kwargs:
|
|
4428
|
+
self.Error = kwargs["Error"]
|
|
4429
|
+
def __del__(self):
|
|
4430
|
+
_linksockslib.DecRef(self.handle)
|
|
4431
|
+
def __str__(self):
|
|
4432
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4433
|
+
sv = 'linksocks.DisconnectMessage{'
|
|
4434
|
+
first = True
|
|
4435
|
+
for v in pr:
|
|
4436
|
+
if callable(v[1]):
|
|
4437
|
+
continue
|
|
4438
|
+
if first:
|
|
4439
|
+
first = False
|
|
4440
|
+
else:
|
|
4441
|
+
sv += ', '
|
|
4442
|
+
sv += v[0] + '=' + str(v[1])
|
|
4443
|
+
return sv + '}'
|
|
4444
|
+
def __repr__(self):
|
|
4445
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4446
|
+
sv = 'linksocks.DisconnectMessage ( '
|
|
4447
|
+
for v in pr:
|
|
4448
|
+
if not callable(v[1]):
|
|
4449
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4450
|
+
return sv + ')'
|
|
4451
|
+
@property
|
|
4452
|
+
def ChannelID(self):
|
|
4453
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_DisconnectMessage_ChannelID_Get(self.handle))
|
|
4454
|
+
@property
|
|
4455
|
+
def Error(self):
|
|
4456
|
+
return _linksockslib.linksocks_DisconnectMessage_Error_Get(self.handle)
|
|
4457
|
+
@Error.setter
|
|
4458
|
+
def Error(self, value):
|
|
4459
|
+
if isinstance(value, go.GoClass):
|
|
4460
|
+
_linksockslib.linksocks_DisconnectMessage_Error_Set(self.handle, value.handle)
|
|
4461
|
+
else:
|
|
4462
|
+
_linksockslib.linksocks_DisconnectMessage_Error_Set(self.handle, value)
|
|
4463
|
+
def GetType(self):
|
|
4464
|
+
"""GetType() str"""
|
|
4465
|
+
return _linksockslib.linksocks_DisconnectMessage_GetType(self.handle)
|
|
4466
|
+
|
|
4467
|
+
# Python type for struct linksocks.TokenResponse
|
|
4468
|
+
class TokenResponse(go.GoClass):
|
|
4469
|
+
"""TokenResponse represents the response for token operations\n"""
|
|
4470
|
+
def __init__(self, *args, **kwargs):
|
|
4471
|
+
"""
|
|
4472
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
4473
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
4474
|
+
in which case a new Go object is constructed first
|
|
4475
|
+
"""
|
|
4476
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
4477
|
+
self.handle = kwargs['handle']
|
|
4478
|
+
_linksockslib.IncRef(self.handle)
|
|
4479
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
4480
|
+
self.handle = args[0].handle
|
|
4481
|
+
_linksockslib.IncRef(self.handle)
|
|
4482
|
+
else:
|
|
4483
|
+
self.handle = _linksockslib.linksocks_TokenResponse_CTor()
|
|
4484
|
+
_linksockslib.IncRef(self.handle)
|
|
4485
|
+
if 0 < len(args):
|
|
4486
|
+
self.Success = args[0]
|
|
4487
|
+
if "Success" in kwargs:
|
|
4488
|
+
self.Success = kwargs["Success"]
|
|
4489
|
+
if 1 < len(args):
|
|
4490
|
+
self.Token = args[1]
|
|
4491
|
+
if "Token" in kwargs:
|
|
4492
|
+
self.Token = kwargs["Token"]
|
|
4493
|
+
if 2 < len(args):
|
|
4494
|
+
self.Port = args[2]
|
|
4495
|
+
if "Port" in kwargs:
|
|
4496
|
+
self.Port = kwargs["Port"]
|
|
4497
|
+
if 3 < len(args):
|
|
4498
|
+
self.Error = args[3]
|
|
4499
|
+
if "Error" in kwargs:
|
|
4500
|
+
self.Error = kwargs["Error"]
|
|
4501
|
+
def __del__(self):
|
|
4502
|
+
_linksockslib.DecRef(self.handle)
|
|
4503
|
+
def __str__(self):
|
|
4504
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4505
|
+
sv = 'linksocks.TokenResponse{'
|
|
4506
|
+
first = True
|
|
4507
|
+
for v in pr:
|
|
4508
|
+
if callable(v[1]):
|
|
4509
|
+
continue
|
|
4510
|
+
if first:
|
|
4511
|
+
first = False
|
|
4512
|
+
else:
|
|
4513
|
+
sv += ', '
|
|
4514
|
+
sv += v[0] + '=' + str(v[1])
|
|
4515
|
+
return sv + '}'
|
|
4516
|
+
def __repr__(self):
|
|
4517
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4518
|
+
sv = 'linksocks.TokenResponse ( '
|
|
4519
|
+
for v in pr:
|
|
4520
|
+
if not callable(v[1]):
|
|
4521
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4522
|
+
return sv + ')'
|
|
4523
|
+
@property
|
|
4524
|
+
def Success(self):
|
|
4525
|
+
return _linksockslib.linksocks_TokenResponse_Success_Get(self.handle)
|
|
4526
|
+
@Success.setter
|
|
4527
|
+
def Success(self, value):
|
|
4528
|
+
if isinstance(value, go.GoClass):
|
|
4529
|
+
_linksockslib.linksocks_TokenResponse_Success_Set(self.handle, value.handle)
|
|
4530
|
+
else:
|
|
4531
|
+
_linksockslib.linksocks_TokenResponse_Success_Set(self.handle, value)
|
|
4532
|
+
@property
|
|
4533
|
+
def Token(self):
|
|
4534
|
+
return _linksockslib.linksocks_TokenResponse_Token_Get(self.handle)
|
|
4535
|
+
@Token.setter
|
|
4536
|
+
def Token(self, value):
|
|
4537
|
+
if isinstance(value, go.GoClass):
|
|
4538
|
+
_linksockslib.linksocks_TokenResponse_Token_Set(self.handle, value.handle)
|
|
4539
|
+
else:
|
|
4540
|
+
_linksockslib.linksocks_TokenResponse_Token_Set(self.handle, value)
|
|
4541
|
+
@property
|
|
4542
|
+
def Port(self):
|
|
4543
|
+
return _linksockslib.linksocks_TokenResponse_Port_Get(self.handle)
|
|
4544
|
+
@Port.setter
|
|
4545
|
+
def Port(self, value):
|
|
4546
|
+
if isinstance(value, go.GoClass):
|
|
4547
|
+
_linksockslib.linksocks_TokenResponse_Port_Set(self.handle, value.handle)
|
|
4548
|
+
else:
|
|
4549
|
+
_linksockslib.linksocks_TokenResponse_Port_Set(self.handle, value)
|
|
4550
|
+
@property
|
|
4551
|
+
def Error(self):
|
|
4552
|
+
return _linksockslib.linksocks_TokenResponse_Error_Get(self.handle)
|
|
4553
|
+
@Error.setter
|
|
4554
|
+
def Error(self, value):
|
|
4555
|
+
if isinstance(value, go.GoClass):
|
|
4556
|
+
_linksockslib.linksocks_TokenResponse_Error_Set(self.handle, value.handle)
|
|
4557
|
+
else:
|
|
4558
|
+
_linksockslib.linksocks_TokenResponse_Error_Set(self.handle, value)
|
|
4559
|
+
|
|
4560
|
+
# Python type for struct linksocks.ReverseTokenStatus
|
|
4561
|
+
class ReverseTokenStatus(TokenStatus):
|
|
4562
|
+
"""ReverseTokenStatus represents the status of a reverse token\n"""
|
|
4563
|
+
def __init__(self, *args, **kwargs):
|
|
4564
|
+
"""
|
|
4565
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
4566
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
4567
|
+
in which case a new Go object is constructed first
|
|
4568
|
+
"""
|
|
4569
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
4570
|
+
self.handle = kwargs['handle']
|
|
4571
|
+
_linksockslib.IncRef(self.handle)
|
|
4572
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
4573
|
+
self.handle = args[0].handle
|
|
4574
|
+
_linksockslib.IncRef(self.handle)
|
|
4575
|
+
else:
|
|
4576
|
+
self.handle = _linksockslib.linksocks_ReverseTokenStatus_CTor()
|
|
4577
|
+
_linksockslib.IncRef(self.handle)
|
|
4578
|
+
if 1 < len(args):
|
|
4579
|
+
self.Port = args[1]
|
|
4580
|
+
if "Port" in kwargs:
|
|
4581
|
+
self.Port = kwargs["Port"]
|
|
4582
|
+
if 2 < len(args):
|
|
4583
|
+
self.ConnectorTokens = args[2]
|
|
4584
|
+
if "ConnectorTokens" in kwargs:
|
|
4585
|
+
self.ConnectorTokens = kwargs["ConnectorTokens"]
|
|
4586
|
+
def __del__(self):
|
|
4587
|
+
_linksockslib.DecRef(self.handle)
|
|
4588
|
+
def __str__(self):
|
|
4589
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4590
|
+
sv = 'linksocks.ReverseTokenStatus{'
|
|
4591
|
+
first = True
|
|
4592
|
+
for v in pr:
|
|
4593
|
+
if callable(v[1]):
|
|
4594
|
+
continue
|
|
4595
|
+
if first:
|
|
4596
|
+
first = False
|
|
4597
|
+
else:
|
|
4598
|
+
sv += ', '
|
|
4599
|
+
sv += v[0] + '=' + str(v[1])
|
|
4600
|
+
return sv + '}'
|
|
4601
|
+
def __repr__(self):
|
|
4602
|
+
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
4603
|
+
sv = 'linksocks.ReverseTokenStatus ( '
|
|
4604
|
+
for v in pr:
|
|
4605
|
+
if not callable(v[1]):
|
|
4606
|
+
sv += v[0] + '=' + str(v[1]) + ', '
|
|
4607
|
+
return sv + ')'
|
|
4608
|
+
@property
|
|
4609
|
+
def Port(self):
|
|
4610
|
+
return _linksockslib.linksocks_ReverseTokenStatus_Port_Get(self.handle)
|
|
4611
|
+
@Port.setter
|
|
4612
|
+
def Port(self, value):
|
|
4613
|
+
if isinstance(value, go.GoClass):
|
|
4614
|
+
_linksockslib.linksocks_ReverseTokenStatus_Port_Set(self.handle, value.handle)
|
|
4615
|
+
else:
|
|
4616
|
+
_linksockslib.linksocks_ReverseTokenStatus_Port_Set(self.handle, value)
|
|
4617
|
+
@property
|
|
4618
|
+
def ConnectorTokens(self):
|
|
4619
|
+
return go.Slice_string(handle=_linksockslib.linksocks_ReverseTokenStatus_ConnectorTokens_Get(self.handle))
|
|
4620
|
+
@ConnectorTokens.setter
|
|
4621
|
+
def ConnectorTokens(self, value):
|
|
4622
|
+
if isinstance(value, go.GoClass):
|
|
4623
|
+
_linksockslib.linksocks_ReverseTokenStatus_ConnectorTokens_Set(self.handle, value.handle)
|
|
4624
|
+
else:
|
|
4625
|
+
raise TypeError("supplied argument type {t} is not a go.GoClass".format(t=type(value)))
|
|
4626
|
+
|
|
4627
|
+
# Python type for struct linksocks.ClientOption
|
|
4628
|
+
class ClientOption(go.GoClass):
|
|
4629
|
+
"""ClientOption represents configuration options for LinkSocksClient\n"""
|
|
4630
|
+
def __init__(self, *args, **kwargs):
|
|
4631
|
+
"""
|
|
4632
|
+
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
4633
|
+
otherwise parameters can be unnamed in order of field names or named fields
|
|
4634
|
+
in which case a new Go object is constructed first
|
|
4635
|
+
"""
|
|
4636
|
+
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
4637
|
+
self.handle = kwargs['handle']
|
|
4638
|
+
_linksockslib.IncRef(self.handle)
|
|
4639
|
+
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
4640
|
+
self.handle = args[0].handle
|
|
4641
|
+
_linksockslib.IncRef(self.handle)
|
|
4642
|
+
else:
|
|
4643
|
+
self.handle = _linksockslib.linksocks_ClientOption_CTor()
|
|
4644
|
+
_linksockslib.IncRef(self.handle)
|
|
4645
|
+
if 0 < len(args):
|
|
4646
|
+
self.WSURL = args[0]
|
|
4647
|
+
if "WSURL" in kwargs:
|
|
4648
|
+
self.WSURL = kwargs["WSURL"]
|
|
4649
|
+
if 1 < len(args):
|
|
4650
|
+
self.Reverse = args[1]
|
|
4788
4651
|
if "Reverse" in kwargs:
|
|
4789
4652
|
self.Reverse = kwargs["Reverse"]
|
|
4790
4653
|
if 2 < len(args):
|
|
@@ -5157,9 +5020,9 @@ class ClientOption(go.GoClass):
|
|
|
5157
5020
|
"""
|
|
5158
5021
|
return ClientOption(handle=_linksockslib.linksocks_ClientOption_WithNoEnvProxy(self.handle, noEnvProxy))
|
|
5159
5022
|
|
|
5160
|
-
# Python type for struct linksocks.
|
|
5161
|
-
class
|
|
5162
|
-
"""
|
|
5023
|
+
# Python type for struct linksocks.LogEntry
|
|
5024
|
+
class LogEntry(go.GoClass):
|
|
5025
|
+
"""LogEntry represents a single log entry with metadata\n"""
|
|
5163
5026
|
def __init__(self, *args, **kwargs):
|
|
5164
5027
|
"""
|
|
5165
5028
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5173,21 +5036,25 @@ class DisconnectMessage(go.GoClass):
|
|
|
5173
5036
|
self.handle = args[0].handle
|
|
5174
5037
|
_linksockslib.IncRef(self.handle)
|
|
5175
5038
|
else:
|
|
5176
|
-
self.handle = _linksockslib.
|
|
5039
|
+
self.handle = _linksockslib.linksocks_LogEntry_CTor()
|
|
5177
5040
|
_linksockslib.IncRef(self.handle)
|
|
5178
5041
|
if 0 < len(args):
|
|
5179
|
-
self.
|
|
5180
|
-
if "
|
|
5181
|
-
self.
|
|
5042
|
+
self.LoggerID = args[0]
|
|
5043
|
+
if "LoggerID" in kwargs:
|
|
5044
|
+
self.LoggerID = kwargs["LoggerID"]
|
|
5182
5045
|
if 1 < len(args):
|
|
5183
|
-
self.
|
|
5184
|
-
if "
|
|
5185
|
-
self.
|
|
5046
|
+
self.Message = args[1]
|
|
5047
|
+
if "Message" in kwargs:
|
|
5048
|
+
self.Message = kwargs["Message"]
|
|
5049
|
+
if 2 < len(args):
|
|
5050
|
+
self.Time = args[2]
|
|
5051
|
+
if "Time" in kwargs:
|
|
5052
|
+
self.Time = kwargs["Time"]
|
|
5186
5053
|
def __del__(self):
|
|
5187
5054
|
_linksockslib.DecRef(self.handle)
|
|
5188
5055
|
def __str__(self):
|
|
5189
5056
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5190
|
-
sv = 'linksocks.
|
|
5057
|
+
sv = 'linksocks.LogEntry{'
|
|
5191
5058
|
first = True
|
|
5192
5059
|
for v in pr:
|
|
5193
5060
|
if callable(v[1]):
|
|
@@ -5200,142 +5067,42 @@ class DisconnectMessage(go.GoClass):
|
|
|
5200
5067
|
return sv + '}'
|
|
5201
5068
|
def __repr__(self):
|
|
5202
5069
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5203
|
-
sv = 'linksocks.
|
|
5070
|
+
sv = 'linksocks.LogEntry ( '
|
|
5204
5071
|
for v in pr:
|
|
5205
5072
|
if not callable(v[1]):
|
|
5206
5073
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5207
5074
|
return sv + ')'
|
|
5208
5075
|
@property
|
|
5209
|
-
def
|
|
5210
|
-
return
|
|
5211
|
-
@
|
|
5212
|
-
def
|
|
5213
|
-
return _linksockslib.linksocks_DisconnectMessage_Error_Get(self.handle)
|
|
5214
|
-
@Error.setter
|
|
5215
|
-
def Error(self, value):
|
|
5076
|
+
def LoggerID(self):
|
|
5077
|
+
return _linksockslib.linksocks_LogEntry_LoggerID_Get(self.handle)
|
|
5078
|
+
@LoggerID.setter
|
|
5079
|
+
def LoggerID(self, value):
|
|
5216
5080
|
if isinstance(value, go.GoClass):
|
|
5217
|
-
_linksockslib.
|
|
5081
|
+
_linksockslib.linksocks_LogEntry_LoggerID_Set(self.handle, value.handle)
|
|
5218
5082
|
else:
|
|
5219
|
-
_linksockslib.
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
return _linksockslib.
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
def __init__(self, *args, **kwargs):
|
|
5228
|
-
"""
|
|
5229
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
5230
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
5231
|
-
in which case a new Go object is constructed first
|
|
5232
|
-
"""
|
|
5233
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
5234
|
-
self.handle = kwargs['handle']
|
|
5235
|
-
_linksockslib.IncRef(self.handle)
|
|
5236
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
5237
|
-
self.handle = args[0].handle
|
|
5238
|
-
_linksockslib.IncRef(self.handle)
|
|
5083
|
+
_linksockslib.linksocks_LogEntry_LoggerID_Set(self.handle, value)
|
|
5084
|
+
@property
|
|
5085
|
+
def Message(self):
|
|
5086
|
+
return _linksockslib.linksocks_LogEntry_Message_Get(self.handle)
|
|
5087
|
+
@Message.setter
|
|
5088
|
+
def Message(self, value):
|
|
5089
|
+
if isinstance(value, go.GoClass):
|
|
5090
|
+
_linksockslib.linksocks_LogEntry_Message_Set(self.handle, value.handle)
|
|
5239
5091
|
else:
|
|
5240
|
-
self.handle
|
|
5241
|
-
|
|
5242
|
-
def
|
|
5243
|
-
_linksockslib.
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
for v in pr:
|
|
5249
|
-
if callable(v[1]):
|
|
5250
|
-
continue
|
|
5251
|
-
if first:
|
|
5252
|
-
first = False
|
|
5253
|
-
else:
|
|
5254
|
-
sv += ', '
|
|
5255
|
-
sv += v[0] + '=' + str(v[1])
|
|
5256
|
-
return sv + '}'
|
|
5257
|
-
def __repr__(self):
|
|
5258
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5259
|
-
sv = 'linksocks.DynamicForwarder ( '
|
|
5260
|
-
for v in pr:
|
|
5261
|
-
if not callable(v[1]):
|
|
5262
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5263
|
-
return sv + ')'
|
|
5264
|
-
def ProcessReads(self, conn, goRun=False):
|
|
5265
|
-
"""ProcessReads(object conn)
|
|
5266
|
-
|
|
5267
|
-
ProcessReads handles reading from a network connection and forwarding to WebSocket with dynamic batching
|
|
5268
|
-
"""
|
|
5269
|
-
_linksockslib.linksocks_DynamicForwarder_ProcessReads(self.handle, conn.handle, goRun)
|
|
5270
|
-
def ProcessReadsImmediate(self, conn, goRun=False):
|
|
5271
|
-
"""ProcessReadsImmediate(object conn)
|
|
5272
|
-
|
|
5273
|
-
processReadsImmediate handles reading directly without batching
|
|
5274
|
-
"""
|
|
5275
|
-
_linksockslib.linksocks_DynamicForwarder_ProcessReadsImmediate(self.handle, conn.handle, goRun)
|
|
5276
|
-
def ProcessUDPReads(self, conn, goRun=False):
|
|
5277
|
-
"""ProcessUDPReads(object conn)
|
|
5278
|
-
|
|
5279
|
-
ProcessUDPReads handles reading from a UDP connection with appropriate metadata
|
|
5280
|
-
"""
|
|
5281
|
-
_linksockslib.linksocks_DynamicForwarder_ProcessUDPReads(self.handle, conn.handle, goRun)
|
|
5282
|
-
|
|
5283
|
-
# Python type for struct linksocks.SocketManager
|
|
5284
|
-
class SocketManager(go.GoClass):
|
|
5285
|
-
"""SocketManager manages socket lifecycle and reuse\n"""
|
|
5286
|
-
def __init__(self, *args, **kwargs):
|
|
5287
|
-
"""
|
|
5288
|
-
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
5289
|
-
otherwise parameters can be unnamed in order of field names or named fields
|
|
5290
|
-
in which case a new Go object is constructed first
|
|
5291
|
-
"""
|
|
5292
|
-
if len(kwargs) == 1 and 'handle' in kwargs:
|
|
5293
|
-
self.handle = kwargs['handle']
|
|
5294
|
-
_linksockslib.IncRef(self.handle)
|
|
5295
|
-
elif len(args) == 1 and isinstance(args[0], go.GoClass):
|
|
5296
|
-
self.handle = args[0].handle
|
|
5297
|
-
_linksockslib.IncRef(self.handle)
|
|
5092
|
+
_linksockslib.linksocks_LogEntry_Message_Set(self.handle, value)
|
|
5093
|
+
@property
|
|
5094
|
+
def Time(self):
|
|
5095
|
+
return _linksockslib.linksocks_LogEntry_Time_Get(self.handle)
|
|
5096
|
+
@Time.setter
|
|
5097
|
+
def Time(self, value):
|
|
5098
|
+
if isinstance(value, go.GoClass):
|
|
5099
|
+
_linksockslib.linksocks_LogEntry_Time_Set(self.handle, value.handle)
|
|
5298
5100
|
else:
|
|
5299
|
-
self.handle
|
|
5300
|
-
_linksockslib.IncRef(self.handle)
|
|
5301
|
-
def __del__(self):
|
|
5302
|
-
_linksockslib.DecRef(self.handle)
|
|
5303
|
-
def __str__(self):
|
|
5304
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5305
|
-
sv = 'linksocks.SocketManager{'
|
|
5306
|
-
first = True
|
|
5307
|
-
for v in pr:
|
|
5308
|
-
if callable(v[1]):
|
|
5309
|
-
continue
|
|
5310
|
-
if first:
|
|
5311
|
-
first = False
|
|
5312
|
-
else:
|
|
5313
|
-
sv += ', '
|
|
5314
|
-
sv += v[0] + '=' + str(v[1])
|
|
5315
|
-
return sv + '}'
|
|
5316
|
-
def __repr__(self):
|
|
5317
|
-
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5318
|
-
sv = 'linksocks.SocketManager ( '
|
|
5319
|
-
for v in pr:
|
|
5320
|
-
if not callable(v[1]):
|
|
5321
|
-
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5322
|
-
return sv + ')'
|
|
5323
|
-
def GetListener(self, port):
|
|
5324
|
-
"""GetListener(int port) object, str"""
|
|
5325
|
-
return go.net_Listener(handle=_linksockslib.linksocks_SocketManager_GetListener(self.handle, port))
|
|
5326
|
-
def ReleaseListener(self, port, goRun=False):
|
|
5327
|
-
"""ReleaseListener(int port) """
|
|
5328
|
-
_linksockslib.linksocks_SocketManager_ReleaseListener(self.handle, port, goRun)
|
|
5329
|
-
def Close(self, goRun=False):
|
|
5330
|
-
"""Close()
|
|
5331
|
-
|
|
5332
|
-
Close closes all managed sockets immediately
|
|
5333
|
-
"""
|
|
5334
|
-
_linksockslib.linksocks_SocketManager_Close(self.handle, goRun)
|
|
5101
|
+
_linksockslib.linksocks_LogEntry_Time_Set(self.handle, value)
|
|
5335
5102
|
|
|
5336
|
-
# Python type for struct linksocks.
|
|
5337
|
-
class
|
|
5338
|
-
"""
|
|
5103
|
+
# Python type for struct linksocks.RelayOption
|
|
5104
|
+
class RelayOption(go.GoClass):
|
|
5105
|
+
"""RelayOption contains configuration options for Relay\n"""
|
|
5339
5106
|
def __init__(self, *args, **kwargs):
|
|
5340
5107
|
"""
|
|
5341
5108
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5349,29 +5116,65 @@ class TokenResponse(go.GoClass):
|
|
|
5349
5116
|
self.handle = args[0].handle
|
|
5350
5117
|
_linksockslib.IncRef(self.handle)
|
|
5351
5118
|
else:
|
|
5352
|
-
self.handle = _linksockslib.
|
|
5119
|
+
self.handle = _linksockslib.linksocks_RelayOption_CTor()
|
|
5353
5120
|
_linksockslib.IncRef(self.handle)
|
|
5354
5121
|
if 0 < len(args):
|
|
5355
|
-
self.
|
|
5356
|
-
if "
|
|
5357
|
-
self.
|
|
5122
|
+
self.BufferSize = args[0]
|
|
5123
|
+
if "BufferSize" in kwargs:
|
|
5124
|
+
self.BufferSize = kwargs["BufferSize"]
|
|
5358
5125
|
if 1 < len(args):
|
|
5359
|
-
self.
|
|
5360
|
-
if "
|
|
5361
|
-
self.
|
|
5126
|
+
self.ChannelTimeout = args[1]
|
|
5127
|
+
if "ChannelTimeout" in kwargs:
|
|
5128
|
+
self.ChannelTimeout = kwargs["ChannelTimeout"]
|
|
5362
5129
|
if 2 < len(args):
|
|
5363
|
-
self.
|
|
5364
|
-
if "
|
|
5365
|
-
self.
|
|
5130
|
+
self.ConnectTimeout = args[2]
|
|
5131
|
+
if "ConnectTimeout" in kwargs:
|
|
5132
|
+
self.ConnectTimeout = kwargs["ConnectTimeout"]
|
|
5366
5133
|
if 3 < len(args):
|
|
5367
|
-
self.
|
|
5368
|
-
if "
|
|
5369
|
-
self.
|
|
5134
|
+
self.FastOpen = args[3]
|
|
5135
|
+
if "FastOpen" in kwargs:
|
|
5136
|
+
self.FastOpen = kwargs["FastOpen"]
|
|
5137
|
+
if 4 < len(args):
|
|
5138
|
+
self.UpstreamProxy = args[4]
|
|
5139
|
+
if "UpstreamProxy" in kwargs:
|
|
5140
|
+
self.UpstreamProxy = kwargs["UpstreamProxy"]
|
|
5141
|
+
if 5 < len(args):
|
|
5142
|
+
self.UpstreamUsername = args[5]
|
|
5143
|
+
if "UpstreamUsername" in kwargs:
|
|
5144
|
+
self.UpstreamUsername = kwargs["UpstreamUsername"]
|
|
5145
|
+
if 6 < len(args):
|
|
5146
|
+
self.UpstreamPassword = args[6]
|
|
5147
|
+
if "UpstreamPassword" in kwargs:
|
|
5148
|
+
self.UpstreamPassword = kwargs["UpstreamPassword"]
|
|
5149
|
+
if 7 < len(args):
|
|
5150
|
+
self.EnableDynamicBatching = args[7]
|
|
5151
|
+
if "EnableDynamicBatching" in kwargs:
|
|
5152
|
+
self.EnableDynamicBatching = kwargs["EnableDynamicBatching"]
|
|
5153
|
+
if 8 < len(args):
|
|
5154
|
+
self.MaxBatchWaitTime = args[8]
|
|
5155
|
+
if "MaxBatchWaitTime" in kwargs:
|
|
5156
|
+
self.MaxBatchWaitTime = kwargs["MaxBatchWaitTime"]
|
|
5157
|
+
if 9 < len(args):
|
|
5158
|
+
self.MinBatchWaitTime = args[9]
|
|
5159
|
+
if "MinBatchWaitTime" in kwargs:
|
|
5160
|
+
self.MinBatchWaitTime = kwargs["MinBatchWaitTime"]
|
|
5161
|
+
if 10 < len(args):
|
|
5162
|
+
self.HighSpeedThreshold = args[10]
|
|
5163
|
+
if "HighSpeedThreshold" in kwargs:
|
|
5164
|
+
self.HighSpeedThreshold = kwargs["HighSpeedThreshold"]
|
|
5165
|
+
if 11 < len(args):
|
|
5166
|
+
self.LowSpeedThreshold = args[11]
|
|
5167
|
+
if "LowSpeedThreshold" in kwargs:
|
|
5168
|
+
self.LowSpeedThreshold = kwargs["LowSpeedThreshold"]
|
|
5169
|
+
if 12 < len(args):
|
|
5170
|
+
self.CompressionThreshold = args[12]
|
|
5171
|
+
if "CompressionThreshold" in kwargs:
|
|
5172
|
+
self.CompressionThreshold = kwargs["CompressionThreshold"]
|
|
5370
5173
|
def __del__(self):
|
|
5371
5174
|
_linksockslib.DecRef(self.handle)
|
|
5372
5175
|
def __str__(self):
|
|
5373
5176
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5374
|
-
sv = 'linksocks.
|
|
5177
|
+
sv = 'linksocks.RelayOption{'
|
|
5375
5178
|
first = True
|
|
5376
5179
|
for v in pr:
|
|
5377
5180
|
if callable(v[1]):
|
|
@@ -5384,51 +5187,214 @@ class TokenResponse(go.GoClass):
|
|
|
5384
5187
|
return sv + '}'
|
|
5385
5188
|
def __repr__(self):
|
|
5386
5189
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5387
|
-
sv = 'linksocks.
|
|
5190
|
+
sv = 'linksocks.RelayOption ( '
|
|
5388
5191
|
for v in pr:
|
|
5389
5192
|
if not callable(v[1]):
|
|
5390
5193
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5391
5194
|
return sv + ')'
|
|
5392
5195
|
@property
|
|
5393
|
-
def
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5196
|
+
def BufferSize(self):
|
|
5197
|
+
"""BufferSize controls the size of reusable buffers
|
|
5198
|
+
Larger values may improve performance but increase memory usage
|
|
5199
|
+
"""
|
|
5200
|
+
return _linksockslib.linksocks_RelayOption_BufferSize_Get(self.handle)
|
|
5201
|
+
@BufferSize.setter
|
|
5202
|
+
def BufferSize(self, value):
|
|
5397
5203
|
if isinstance(value, go.GoClass):
|
|
5398
|
-
_linksockslib.
|
|
5204
|
+
_linksockslib.linksocks_RelayOption_BufferSize_Set(self.handle, value.handle)
|
|
5399
5205
|
else:
|
|
5400
|
-
_linksockslib.
|
|
5206
|
+
_linksockslib.linksocks_RelayOption_BufferSize_Set(self.handle, value)
|
|
5401
5207
|
@property
|
|
5402
|
-
def
|
|
5403
|
-
return _linksockslib.
|
|
5404
|
-
@
|
|
5405
|
-
def
|
|
5208
|
+
def ChannelTimeout(self):
|
|
5209
|
+
return _linksockslib.linksocks_RelayOption_ChannelTimeout_Get(self.handle)
|
|
5210
|
+
@ChannelTimeout.setter
|
|
5211
|
+
def ChannelTimeout(self, value):
|
|
5406
5212
|
if isinstance(value, go.GoClass):
|
|
5407
|
-
_linksockslib.
|
|
5213
|
+
_linksockslib.linksocks_RelayOption_ChannelTimeout_Set(self.handle, value.handle)
|
|
5408
5214
|
else:
|
|
5409
|
-
_linksockslib.
|
|
5215
|
+
_linksockslib.linksocks_RelayOption_ChannelTimeout_Set(self.handle, value)
|
|
5410
5216
|
@property
|
|
5411
|
-
def
|
|
5412
|
-
return _linksockslib.
|
|
5413
|
-
@
|
|
5414
|
-
def
|
|
5217
|
+
def ConnectTimeout(self):
|
|
5218
|
+
return _linksockslib.linksocks_RelayOption_ConnectTimeout_Get(self.handle)
|
|
5219
|
+
@ConnectTimeout.setter
|
|
5220
|
+
def ConnectTimeout(self, value):
|
|
5415
5221
|
if isinstance(value, go.GoClass):
|
|
5416
|
-
_linksockslib.
|
|
5222
|
+
_linksockslib.linksocks_RelayOption_ConnectTimeout_Set(self.handle, value.handle)
|
|
5417
5223
|
else:
|
|
5418
|
-
_linksockslib.
|
|
5224
|
+
_linksockslib.linksocks_RelayOption_ConnectTimeout_Set(self.handle, value)
|
|
5419
5225
|
@property
|
|
5420
|
-
def
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5226
|
+
def FastOpen(self):
|
|
5227
|
+
"""FastOpen controls whether to wait for connect success response
|
|
5228
|
+
When false, assumes connection success immediately
|
|
5229
|
+
"""
|
|
5230
|
+
return _linksockslib.linksocks_RelayOption_FastOpen_Get(self.handle)
|
|
5231
|
+
@FastOpen.setter
|
|
5232
|
+
def FastOpen(self, value):
|
|
5424
5233
|
if isinstance(value, go.GoClass):
|
|
5425
|
-
_linksockslib.
|
|
5234
|
+
_linksockslib.linksocks_RelayOption_FastOpen_Set(self.handle, value.handle)
|
|
5426
5235
|
else:
|
|
5427
|
-
_linksockslib.
|
|
5236
|
+
_linksockslib.linksocks_RelayOption_FastOpen_Set(self.handle, value)
|
|
5237
|
+
@property
|
|
5238
|
+
def UpstreamProxy(self):
|
|
5239
|
+
"""Upstream SOCKS5 proxy configuration
|
|
5240
|
+
"""
|
|
5241
|
+
return _linksockslib.linksocks_RelayOption_UpstreamProxy_Get(self.handle)
|
|
5242
|
+
@UpstreamProxy.setter
|
|
5243
|
+
def UpstreamProxy(self, value):
|
|
5244
|
+
if isinstance(value, go.GoClass):
|
|
5245
|
+
_linksockslib.linksocks_RelayOption_UpstreamProxy_Set(self.handle, value.handle)
|
|
5246
|
+
else:
|
|
5247
|
+
_linksockslib.linksocks_RelayOption_UpstreamProxy_Set(self.handle, value)
|
|
5248
|
+
@property
|
|
5249
|
+
def UpstreamUsername(self):
|
|
5250
|
+
return _linksockslib.linksocks_RelayOption_UpstreamUsername_Get(self.handle)
|
|
5251
|
+
@UpstreamUsername.setter
|
|
5252
|
+
def UpstreamUsername(self, value):
|
|
5253
|
+
if isinstance(value, go.GoClass):
|
|
5254
|
+
_linksockslib.linksocks_RelayOption_UpstreamUsername_Set(self.handle, value.handle)
|
|
5255
|
+
else:
|
|
5256
|
+
_linksockslib.linksocks_RelayOption_UpstreamUsername_Set(self.handle, value)
|
|
5257
|
+
@property
|
|
5258
|
+
def UpstreamPassword(self):
|
|
5259
|
+
return _linksockslib.linksocks_RelayOption_UpstreamPassword_Get(self.handle)
|
|
5260
|
+
@UpstreamPassword.setter
|
|
5261
|
+
def UpstreamPassword(self, value):
|
|
5262
|
+
if isinstance(value, go.GoClass):
|
|
5263
|
+
_linksockslib.linksocks_RelayOption_UpstreamPassword_Set(self.handle, value.handle)
|
|
5264
|
+
else:
|
|
5265
|
+
_linksockslib.linksocks_RelayOption_UpstreamPassword_Set(self.handle, value)
|
|
5266
|
+
@property
|
|
5267
|
+
def EnableDynamicBatching(self):
|
|
5268
|
+
"""Adaptive batching configuration
|
|
5269
|
+
"""
|
|
5270
|
+
return _linksockslib.linksocks_RelayOption_EnableDynamicBatching_Get(self.handle)
|
|
5271
|
+
@EnableDynamicBatching.setter
|
|
5272
|
+
def EnableDynamicBatching(self, value):
|
|
5273
|
+
if isinstance(value, go.GoClass):
|
|
5274
|
+
_linksockslib.linksocks_RelayOption_EnableDynamicBatching_Set(self.handle, value.handle)
|
|
5275
|
+
else:
|
|
5276
|
+
_linksockslib.linksocks_RelayOption_EnableDynamicBatching_Set(self.handle, value)
|
|
5277
|
+
@property
|
|
5278
|
+
def MaxBatchWaitTime(self):
|
|
5279
|
+
return _linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Get(self.handle)
|
|
5280
|
+
@MaxBatchWaitTime.setter
|
|
5281
|
+
def MaxBatchWaitTime(self, value):
|
|
5282
|
+
if isinstance(value, go.GoClass):
|
|
5283
|
+
_linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Set(self.handle, value.handle)
|
|
5284
|
+
else:
|
|
5285
|
+
_linksockslib.linksocks_RelayOption_MaxBatchWaitTime_Set(self.handle, value)
|
|
5286
|
+
@property
|
|
5287
|
+
def MinBatchWaitTime(self):
|
|
5288
|
+
return _linksockslib.linksocks_RelayOption_MinBatchWaitTime_Get(self.handle)
|
|
5289
|
+
@MinBatchWaitTime.setter
|
|
5290
|
+
def MinBatchWaitTime(self, value):
|
|
5291
|
+
if isinstance(value, go.GoClass):
|
|
5292
|
+
_linksockslib.linksocks_RelayOption_MinBatchWaitTime_Set(self.handle, value.handle)
|
|
5293
|
+
else:
|
|
5294
|
+
_linksockslib.linksocks_RelayOption_MinBatchWaitTime_Set(self.handle, value)
|
|
5295
|
+
@property
|
|
5296
|
+
def HighSpeedThreshold(self):
|
|
5297
|
+
"""HighSpeedThreshold defines the bytes/sec rate above which batch delay increases
|
|
5298
|
+
"""
|
|
5299
|
+
return _linksockslib.linksocks_RelayOption_HighSpeedThreshold_Get(self.handle)
|
|
5300
|
+
@HighSpeedThreshold.setter
|
|
5301
|
+
def HighSpeedThreshold(self, value):
|
|
5302
|
+
if isinstance(value, go.GoClass):
|
|
5303
|
+
_linksockslib.linksocks_RelayOption_HighSpeedThreshold_Set(self.handle, value.handle)
|
|
5304
|
+
else:
|
|
5305
|
+
_linksockslib.linksocks_RelayOption_HighSpeedThreshold_Set(self.handle, value)
|
|
5306
|
+
@property
|
|
5307
|
+
def LowSpeedThreshold(self):
|
|
5308
|
+
"""LowSpeedThreshold defines the bytes/sec rate below which batch delay resets to zero
|
|
5309
|
+
"""
|
|
5310
|
+
return _linksockslib.linksocks_RelayOption_LowSpeedThreshold_Get(self.handle)
|
|
5311
|
+
@LowSpeedThreshold.setter
|
|
5312
|
+
def LowSpeedThreshold(self, value):
|
|
5313
|
+
if isinstance(value, go.GoClass):
|
|
5314
|
+
_linksockslib.linksocks_RelayOption_LowSpeedThreshold_Set(self.handle, value.handle)
|
|
5315
|
+
else:
|
|
5316
|
+
_linksockslib.linksocks_RelayOption_LowSpeedThreshold_Set(self.handle, value)
|
|
5317
|
+
@property
|
|
5318
|
+
def CompressionThreshold(self):
|
|
5319
|
+
"""CompressionThreshold defines the data size in bytes above which compression is applied
|
|
5320
|
+
"""
|
|
5321
|
+
return _linksockslib.linksocks_RelayOption_CompressionThreshold_Get(self.handle)
|
|
5322
|
+
@CompressionThreshold.setter
|
|
5323
|
+
def CompressionThreshold(self, value):
|
|
5324
|
+
if isinstance(value, go.GoClass):
|
|
5325
|
+
_linksockslib.linksocks_RelayOption_CompressionThreshold_Set(self.handle, value.handle)
|
|
5326
|
+
else:
|
|
5327
|
+
_linksockslib.linksocks_RelayOption_CompressionThreshold_Set(self.handle, value)
|
|
5328
|
+
def WithBufferSize(self, size):
|
|
5329
|
+
"""WithBufferSize(int size) object
|
|
5330
|
+
|
|
5331
|
+
WithBufferSize sets the buffer size for the relay
|
|
5332
|
+
"""
|
|
5333
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithBufferSize(self.handle, size))
|
|
5334
|
+
def WithChannelTimeout(self, timeout):
|
|
5335
|
+
"""WithChannelTimeout(long timeout) object
|
|
5336
|
+
|
|
5337
|
+
WithChannelTimeout sets the channel timeout for the relay
|
|
5338
|
+
"""
|
|
5339
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithChannelTimeout(self.handle, timeout))
|
|
5340
|
+
def WithConnectTimeout(self, timeout):
|
|
5341
|
+
"""WithConnectTimeout(long timeout) object
|
|
5342
|
+
|
|
5343
|
+
WithConnectTimeout sets the connect timeout for the relay
|
|
5344
|
+
"""
|
|
5345
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithConnectTimeout(self.handle, timeout))
|
|
5346
|
+
def WithFastOpen(self, fastOpen):
|
|
5347
|
+
"""WithFastOpen(bool fastOpen) object
|
|
5348
|
+
|
|
5349
|
+
WithFastOpen sets the fast open mode for the relay
|
|
5350
|
+
"""
|
|
5351
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithFastOpen(self.handle, fastOpen))
|
|
5352
|
+
def WithUpstreamProxy(self, proxy):
|
|
5353
|
+
"""WithUpstreamProxy(str proxy) object
|
|
5354
|
+
|
|
5355
|
+
WithUpstreamProxy sets the upstream SOCKS5 proxy
|
|
5356
|
+
"""
|
|
5357
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithUpstreamProxy(self.handle, proxy))
|
|
5358
|
+
def WithUpstreamAuth(self, username, password):
|
|
5359
|
+
"""WithUpstreamAuth(str username, str password) object
|
|
5360
|
+
|
|
5361
|
+
WithUpstreamAuth sets the upstream SOCKS5 proxy authentication
|
|
5362
|
+
"""
|
|
5363
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithUpstreamAuth(self.handle, username, password))
|
|
5364
|
+
def WithDynamicBatching(self, enabled):
|
|
5365
|
+
"""WithDynamicBatching(bool enabled) object
|
|
5366
|
+
|
|
5367
|
+
WithDynamicBatching enables or disables adaptive batching for SOCKS TCP
|
|
5368
|
+
"""
|
|
5369
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithDynamicBatching(self.handle, enabled))
|
|
5370
|
+
def WithBatchingTimeLimits(self, min, max):
|
|
5371
|
+
"""WithBatchingTimeLimits(long min, long max) object
|
|
5372
|
+
|
|
5373
|
+
WithBatchingTimeLimits sets the min/max wait times for SOCKS TCP batching
|
|
5374
|
+
"""
|
|
5375
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithBatchingTimeLimits(self.handle, min, max))
|
|
5376
|
+
def WithHighSpeedThreshold(self, threshold):
|
|
5377
|
+
"""WithHighSpeedThreshold(float threshold) object
|
|
5378
|
+
|
|
5379
|
+
WithHighSpeedThreshold sets the threshold for increasing batch delay
|
|
5380
|
+
"""
|
|
5381
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithHighSpeedThreshold(self.handle, threshold))
|
|
5382
|
+
def WithLowSpeedThreshold(self, threshold):
|
|
5383
|
+
"""WithLowSpeedThreshold(float threshold) object
|
|
5384
|
+
|
|
5385
|
+
WithLowSpeedThreshold sets the threshold for reverting to immediate send
|
|
5386
|
+
"""
|
|
5387
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithLowSpeedThreshold(self.handle, threshold))
|
|
5388
|
+
def WithCompressionThreshold(self, threshold):
|
|
5389
|
+
"""WithCompressionThreshold(int threshold) object
|
|
5390
|
+
|
|
5391
|
+
WithCompressionThreshold sets the threshold for enabling data compression
|
|
5392
|
+
"""
|
|
5393
|
+
return RelayOption(handle=_linksockslib.linksocks_RelayOption_WithCompressionThreshold(self.handle, threshold))
|
|
5428
5394
|
|
|
5429
|
-
# Python type for struct linksocks.
|
|
5430
|
-
class
|
|
5431
|
-
"""
|
|
5395
|
+
# Python type for struct linksocks.ReverseTokenOptions
|
|
5396
|
+
class ReverseTokenOptions(go.GoClass):
|
|
5397
|
+
"""ReverseTokenOptions represents configuration options for reverse token\n"""
|
|
5432
5398
|
def __init__(self, *args, **kwargs):
|
|
5433
5399
|
"""
|
|
5434
5400
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5442,29 +5408,33 @@ class ConnectorResponseMessage(go.GoClass):
|
|
|
5442
5408
|
self.handle = args[0].handle
|
|
5443
5409
|
_linksockslib.IncRef(self.handle)
|
|
5444
5410
|
else:
|
|
5445
|
-
self.handle = _linksockslib.
|
|
5411
|
+
self.handle = _linksockslib.linksocks_ReverseTokenOptions_CTor()
|
|
5446
5412
|
_linksockslib.IncRef(self.handle)
|
|
5447
5413
|
if 0 < len(args):
|
|
5448
|
-
self.
|
|
5449
|
-
if "
|
|
5450
|
-
self.
|
|
5414
|
+
self.Token = args[0]
|
|
5415
|
+
if "Token" in kwargs:
|
|
5416
|
+
self.Token = kwargs["Token"]
|
|
5451
5417
|
if 1 < len(args):
|
|
5452
|
-
self.
|
|
5453
|
-
if "
|
|
5454
|
-
self.
|
|
5418
|
+
self.Port = args[1]
|
|
5419
|
+
if "Port" in kwargs:
|
|
5420
|
+
self.Port = kwargs["Port"]
|
|
5455
5421
|
if 2 < len(args):
|
|
5456
|
-
self.
|
|
5457
|
-
if "
|
|
5458
|
-
self.
|
|
5422
|
+
self.Username = args[2]
|
|
5423
|
+
if "Username" in kwargs:
|
|
5424
|
+
self.Username = kwargs["Username"]
|
|
5459
5425
|
if 3 < len(args):
|
|
5460
|
-
self.
|
|
5461
|
-
if "
|
|
5462
|
-
self.
|
|
5426
|
+
self.Password = args[3]
|
|
5427
|
+
if "Password" in kwargs:
|
|
5428
|
+
self.Password = kwargs["Password"]
|
|
5429
|
+
if 4 < len(args):
|
|
5430
|
+
self.AllowManageConnector = args[4]
|
|
5431
|
+
if "AllowManageConnector" in kwargs:
|
|
5432
|
+
self.AllowManageConnector = kwargs["AllowManageConnector"]
|
|
5463
5433
|
def __del__(self):
|
|
5464
5434
|
_linksockslib.DecRef(self.handle)
|
|
5465
5435
|
def __str__(self):
|
|
5466
5436
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5467
|
-
sv = 'linksocks.
|
|
5437
|
+
sv = 'linksocks.ReverseTokenOptions{'
|
|
5468
5438
|
first = True
|
|
5469
5439
|
for v in pr:
|
|
5470
5440
|
if callable(v[1]):
|
|
@@ -5477,48 +5447,60 @@ class ConnectorResponseMessage(go.GoClass):
|
|
|
5477
5447
|
return sv + '}'
|
|
5478
5448
|
def __repr__(self):
|
|
5479
5449
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5480
|
-
sv = 'linksocks.
|
|
5450
|
+
sv = 'linksocks.ReverseTokenOptions ( '
|
|
5481
5451
|
for v in pr:
|
|
5482
5452
|
if not callable(v[1]):
|
|
5483
5453
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5484
5454
|
return sv + ')'
|
|
5485
5455
|
@property
|
|
5486
|
-
def
|
|
5487
|
-
return _linksockslib.
|
|
5488
|
-
@
|
|
5489
|
-
def
|
|
5456
|
+
def Token(self):
|
|
5457
|
+
return _linksockslib.linksocks_ReverseTokenOptions_Token_Get(self.handle)
|
|
5458
|
+
@Token.setter
|
|
5459
|
+
def Token(self, value):
|
|
5490
5460
|
if isinstance(value, go.GoClass):
|
|
5491
|
-
_linksockslib.
|
|
5461
|
+
_linksockslib.linksocks_ReverseTokenOptions_Token_Set(self.handle, value.handle)
|
|
5492
5462
|
else:
|
|
5493
|
-
_linksockslib.
|
|
5463
|
+
_linksockslib.linksocks_ReverseTokenOptions_Token_Set(self.handle, value)
|
|
5494
5464
|
@property
|
|
5495
|
-
def
|
|
5496
|
-
return _linksockslib.
|
|
5497
|
-
@
|
|
5498
|
-
def
|
|
5465
|
+
def Port(self):
|
|
5466
|
+
return _linksockslib.linksocks_ReverseTokenOptions_Port_Get(self.handle)
|
|
5467
|
+
@Port.setter
|
|
5468
|
+
def Port(self, value):
|
|
5499
5469
|
if isinstance(value, go.GoClass):
|
|
5500
|
-
_linksockslib.
|
|
5470
|
+
_linksockslib.linksocks_ReverseTokenOptions_Port_Set(self.handle, value.handle)
|
|
5501
5471
|
else:
|
|
5502
|
-
_linksockslib.
|
|
5472
|
+
_linksockslib.linksocks_ReverseTokenOptions_Port_Set(self.handle, value)
|
|
5503
5473
|
@property
|
|
5504
|
-
def
|
|
5505
|
-
return
|
|
5474
|
+
def Username(self):
|
|
5475
|
+
return _linksockslib.linksocks_ReverseTokenOptions_Username_Get(self.handle)
|
|
5476
|
+
@Username.setter
|
|
5477
|
+
def Username(self, value):
|
|
5478
|
+
if isinstance(value, go.GoClass):
|
|
5479
|
+
_linksockslib.linksocks_ReverseTokenOptions_Username_Set(self.handle, value.handle)
|
|
5480
|
+
else:
|
|
5481
|
+
_linksockslib.linksocks_ReverseTokenOptions_Username_Set(self.handle, value)
|
|
5506
5482
|
@property
|
|
5507
|
-
def
|
|
5508
|
-
return _linksockslib.
|
|
5509
|
-
@
|
|
5510
|
-
def
|
|
5483
|
+
def Password(self):
|
|
5484
|
+
return _linksockslib.linksocks_ReverseTokenOptions_Password_Get(self.handle)
|
|
5485
|
+
@Password.setter
|
|
5486
|
+
def Password(self, value):
|
|
5511
5487
|
if isinstance(value, go.GoClass):
|
|
5512
|
-
_linksockslib.
|
|
5488
|
+
_linksockslib.linksocks_ReverseTokenOptions_Password_Set(self.handle, value.handle)
|
|
5513
5489
|
else:
|
|
5514
|
-
_linksockslib.
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
return _linksockslib.
|
|
5490
|
+
_linksockslib.linksocks_ReverseTokenOptions_Password_Set(self.handle, value)
|
|
5491
|
+
@property
|
|
5492
|
+
def AllowManageConnector(self):
|
|
5493
|
+
return _linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Get(self.handle)
|
|
5494
|
+
@AllowManageConnector.setter
|
|
5495
|
+
def AllowManageConnector(self, value):
|
|
5496
|
+
if isinstance(value, go.GoClass):
|
|
5497
|
+
_linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Set(self.handle, value.handle)
|
|
5498
|
+
else:
|
|
5499
|
+
_linksockslib.linksocks_ReverseTokenOptions_AllowManageConnector_Set(self.handle, value)
|
|
5518
5500
|
|
|
5519
|
-
# Python type for struct linksocks.
|
|
5520
|
-
class
|
|
5521
|
-
"""
|
|
5501
|
+
# Python type for struct linksocks.ConnectMessage
|
|
5502
|
+
class ConnectMessage(go.GoClass):
|
|
5503
|
+
"""ConnectMessage represents a TCP connection request\n"""
|
|
5522
5504
|
def __init__(self, *args, **kwargs):
|
|
5523
5505
|
"""
|
|
5524
5506
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5532,17 +5514,29 @@ class LinkSocksClient(go.GoClass):
|
|
|
5532
5514
|
self.handle = args[0].handle
|
|
5533
5515
|
_linksockslib.IncRef(self.handle)
|
|
5534
5516
|
else:
|
|
5535
|
-
self.handle = _linksockslib.
|
|
5517
|
+
self.handle = _linksockslib.linksocks_ConnectMessage_CTor()
|
|
5536
5518
|
_linksockslib.IncRef(self.handle)
|
|
5519
|
+
if 0 < len(args):
|
|
5520
|
+
self.Protocol = args[0]
|
|
5521
|
+
if "Protocol" in kwargs:
|
|
5522
|
+
self.Protocol = kwargs["Protocol"]
|
|
5523
|
+
if 1 < len(args):
|
|
5524
|
+
self.Address = args[1]
|
|
5525
|
+
if "Address" in kwargs:
|
|
5526
|
+
self.Address = kwargs["Address"]
|
|
5537
5527
|
if 2 < len(args):
|
|
5538
|
-
self.
|
|
5539
|
-
if "
|
|
5540
|
-
self.
|
|
5528
|
+
self.Port = args[2]
|
|
5529
|
+
if "Port" in kwargs:
|
|
5530
|
+
self.Port = kwargs["Port"]
|
|
5531
|
+
if 3 < len(args):
|
|
5532
|
+
self.ChannelID = args[3]
|
|
5533
|
+
if "ChannelID" in kwargs:
|
|
5534
|
+
self.ChannelID = kwargs["ChannelID"]
|
|
5541
5535
|
def __del__(self):
|
|
5542
5536
|
_linksockslib.DecRef(self.handle)
|
|
5543
5537
|
def __str__(self):
|
|
5544
5538
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5545
|
-
sv = 'linksocks.
|
|
5539
|
+
sv = 'linksocks.ConnectMessage{'
|
|
5546
5540
|
first = True
|
|
5547
5541
|
for v in pr:
|
|
5548
5542
|
if callable(v[1]):
|
|
@@ -5555,62 +5549,48 @@ class LinkSocksClient(go.GoClass):
|
|
|
5555
5549
|
return sv + '}'
|
|
5556
5550
|
def __repr__(self):
|
|
5557
5551
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5558
|
-
sv = 'linksocks.
|
|
5552
|
+
sv = 'linksocks.ConnectMessage ( '
|
|
5559
5553
|
for v in pr:
|
|
5560
5554
|
if not callable(v[1]):
|
|
5561
5555
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5562
5556
|
return sv + ')'
|
|
5563
5557
|
@property
|
|
5564
|
-
def
|
|
5565
|
-
return _linksockslib.
|
|
5566
|
-
@
|
|
5567
|
-
def
|
|
5558
|
+
def Protocol(self):
|
|
5559
|
+
return _linksockslib.linksocks_ConnectMessage_Protocol_Get(self.handle)
|
|
5560
|
+
@Protocol.setter
|
|
5561
|
+
def Protocol(self, value):
|
|
5568
5562
|
if isinstance(value, go.GoClass):
|
|
5569
|
-
_linksockslib.
|
|
5563
|
+
_linksockslib.linksocks_ConnectMessage_Protocol_Set(self.handle, value.handle)
|
|
5570
5564
|
else:
|
|
5571
|
-
_linksockslib.
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
return _linksockslib.
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
return _linksockslib.linksocks_LinkSocksClient_AddConnector(self.handle, connectorToken)
|
|
5597
|
-
def RemoveConnector(self, connectorToken):
|
|
5598
|
-
"""RemoveConnector(str connectorToken) str
|
|
5599
|
-
|
|
5600
|
-
RemoveConnector sends a request to remove a connector token and waits for response.
|
|
5601
|
-
This function is only available in reverse proxy mode.
|
|
5602
|
-
"""
|
|
5603
|
-
return _linksockslib.linksocks_LinkSocksClient_RemoveConnector(self.handle, connectorToken)
|
|
5604
|
-
def GetPartnersCount(self):
|
|
5605
|
-
"""GetPartnersCount() int
|
|
5606
|
-
|
|
5607
|
-
GetPartnersCount returns the current number of partners
|
|
5608
|
-
"""
|
|
5609
|
-
return _linksockslib.linksocks_LinkSocksClient_GetPartnersCount(self.handle)
|
|
5565
|
+
_linksockslib.linksocks_ConnectMessage_Protocol_Set(self.handle, value)
|
|
5566
|
+
@property
|
|
5567
|
+
def Address(self):
|
|
5568
|
+
return _linksockslib.linksocks_ConnectMessage_Address_Get(self.handle)
|
|
5569
|
+
@Address.setter
|
|
5570
|
+
def Address(self, value):
|
|
5571
|
+
if isinstance(value, go.GoClass):
|
|
5572
|
+
_linksockslib.linksocks_ConnectMessage_Address_Set(self.handle, value.handle)
|
|
5573
|
+
else:
|
|
5574
|
+
_linksockslib.linksocks_ConnectMessage_Address_Set(self.handle, value)
|
|
5575
|
+
@property
|
|
5576
|
+
def Port(self):
|
|
5577
|
+
return _linksockslib.linksocks_ConnectMessage_Port_Get(self.handle)
|
|
5578
|
+
@Port.setter
|
|
5579
|
+
def Port(self, value):
|
|
5580
|
+
if isinstance(value, go.GoClass):
|
|
5581
|
+
_linksockslib.linksocks_ConnectMessage_Port_Set(self.handle, value.handle)
|
|
5582
|
+
else:
|
|
5583
|
+
_linksockslib.linksocks_ConnectMessage_Port_Set(self.handle, value)
|
|
5584
|
+
@property
|
|
5585
|
+
def ChannelID(self):
|
|
5586
|
+
return go.uuid_UUID(handle=_linksockslib.linksocks_ConnectMessage_ChannelID_Get(self.handle))
|
|
5587
|
+
def GetType(self):
|
|
5588
|
+
"""GetType() str"""
|
|
5589
|
+
return _linksockslib.linksocks_ConnectMessage_GetType(self.handle)
|
|
5610
5590
|
|
|
5611
|
-
# Python type for struct linksocks.
|
|
5612
|
-
class
|
|
5613
|
-
"""
|
|
5591
|
+
# Python type for struct linksocks.LinkSocksServer
|
|
5592
|
+
class LinkSocksServer(go.GoClass):
|
|
5593
|
+
"""LinkSocksServer represents a SOCKS5 over WebSocket protocol server\n"""
|
|
5614
5594
|
def __init__(self, *args, **kwargs):
|
|
5615
5595
|
"""
|
|
5616
5596
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5624,17 +5604,13 @@ class PartnersMessage(go.GoClass):
|
|
|
5624
5604
|
self.handle = args[0].handle
|
|
5625
5605
|
_linksockslib.IncRef(self.handle)
|
|
5626
5606
|
else:
|
|
5627
|
-
self.handle = _linksockslib.
|
|
5607
|
+
self.handle = _linksockslib.linksocks_LinkSocksServer_CTor()
|
|
5628
5608
|
_linksockslib.IncRef(self.handle)
|
|
5629
|
-
if 0 < len(args):
|
|
5630
|
-
self.Count = args[0]
|
|
5631
|
-
if "Count" in kwargs:
|
|
5632
|
-
self.Count = kwargs["Count"]
|
|
5633
5609
|
def __del__(self):
|
|
5634
5610
|
_linksockslib.DecRef(self.handle)
|
|
5635
5611
|
def __str__(self):
|
|
5636
5612
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5637
|
-
sv = 'linksocks.
|
|
5613
|
+
sv = 'linksocks.LinkSocksServer{'
|
|
5638
5614
|
first = True
|
|
5639
5615
|
for v in pr:
|
|
5640
5616
|
if callable(v[1]):
|
|
@@ -5647,27 +5623,75 @@ class PartnersMessage(go.GoClass):
|
|
|
5647
5623
|
return sv + '}'
|
|
5648
5624
|
def __repr__(self):
|
|
5649
5625
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5650
|
-
sv = 'linksocks.
|
|
5626
|
+
sv = 'linksocks.LinkSocksServer ( '
|
|
5651
5627
|
for v in pr:
|
|
5652
5628
|
if not callable(v[1]):
|
|
5653
5629
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5654
5630
|
return sv + ')'
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
"""
|
|
5666
|
-
return _linksockslib.
|
|
5631
|
+
def AddReverseToken(self, opts):
|
|
5632
|
+
"""AddReverseToken(object opts) object, str
|
|
5633
|
+
|
|
5634
|
+
AddReverseToken adds a new token for reverse socks and assigns a port
|
|
5635
|
+
"""
|
|
5636
|
+
return ReverseTokenResult(handle=_linksockslib.linksocks_LinkSocksServer_AddReverseToken(self.handle, opts.handle))
|
|
5637
|
+
def AddForwardToken(self, token):
|
|
5638
|
+
"""AddForwardToken(str token) str, str
|
|
5639
|
+
|
|
5640
|
+
AddForwardToken adds a new token for forward socks proxy
|
|
5641
|
+
"""
|
|
5642
|
+
return _linksockslib.linksocks_LinkSocksServer_AddForwardToken(self.handle, token)
|
|
5643
|
+
def AddConnectorToken(self, connectorToken, reverseToken):
|
|
5644
|
+
"""AddConnectorToken(str connectorToken, str reverseToken) str, str
|
|
5645
|
+
|
|
5646
|
+
AddConnectorToken adds a new connector token that forwards requests to a reverse token
|
|
5647
|
+
"""
|
|
5648
|
+
return _linksockslib.linksocks_LinkSocksServer_AddConnectorToken(self.handle, connectorToken, reverseToken)
|
|
5649
|
+
def RemoveToken(self, token):
|
|
5650
|
+
"""RemoveToken(str token) bool
|
|
5651
|
+
|
|
5652
|
+
RemoveToken removes a token and disconnects all its clients
|
|
5653
|
+
"""
|
|
5654
|
+
return _linksockslib.linksocks_LinkSocksServer_RemoveToken(self.handle, token)
|
|
5655
|
+
def Serve(self, ctx):
|
|
5656
|
+
"""Serve(object ctx) str
|
|
5657
|
+
|
|
5658
|
+
Serve starts the WebSocket server and waits for clients
|
|
5659
|
+
"""
|
|
5660
|
+
return _linksockslib.linksocks_LinkSocksServer_Serve(self.handle, ctx.handle)
|
|
5661
|
+
def WaitReady(self, ctx, timeout):
|
|
5662
|
+
"""WaitReady(object ctx, long timeout) str
|
|
5663
|
+
|
|
5664
|
+
WaitReady starts the server and waits for the server to be ready with optional timeout
|
|
5665
|
+
"""
|
|
5666
|
+
return _linksockslib.linksocks_LinkSocksServer_WaitReady(self.handle, ctx.handle, timeout)
|
|
5667
|
+
def Close(self, goRun=False):
|
|
5668
|
+
"""Close()
|
|
5669
|
+
|
|
5670
|
+
Close gracefully shuts down the LinkSocksServer
|
|
5671
|
+
"""
|
|
5672
|
+
_linksockslib.linksocks_LinkSocksServer_Close(self.handle, goRun)
|
|
5673
|
+
def GetClientCount(self):
|
|
5674
|
+
"""GetClientCount() int
|
|
5675
|
+
|
|
5676
|
+
GetClientCount returns the total number of connected clients
|
|
5677
|
+
"""
|
|
5678
|
+
return _linksockslib.linksocks_LinkSocksServer_GetClientCount(self.handle)
|
|
5679
|
+
def HasClients(self):
|
|
5680
|
+
"""HasClients() bool
|
|
5681
|
+
|
|
5682
|
+
HasClients returns true if there are any connected clients
|
|
5683
|
+
"""
|
|
5684
|
+
return _linksockslib.linksocks_LinkSocksServer_HasClients(self.handle)
|
|
5685
|
+
def GetTokenClientCount(self, token):
|
|
5686
|
+
"""GetTokenClientCount(str token) int
|
|
5687
|
+
|
|
5688
|
+
GetTokenClientCount counts clients connected for a given token
|
|
5689
|
+
"""
|
|
5690
|
+
return _linksockslib.linksocks_LinkSocksServer_GetTokenClientCount(self.handle, token)
|
|
5667
5691
|
|
|
5668
|
-
# Python type for struct linksocks.
|
|
5669
|
-
class
|
|
5670
|
-
"""
|
|
5692
|
+
# Python type for struct linksocks.SocketManager
|
|
5693
|
+
class SocketManager(go.GoClass):
|
|
5694
|
+
"""SocketManager manages socket lifecycle and reuse\n"""
|
|
5671
5695
|
def __init__(self, *args, **kwargs):
|
|
5672
5696
|
"""
|
|
5673
5697
|
handle=A Go-side object is always initialized with an explicit handle=arg
|
|
@@ -5681,25 +5705,13 @@ class ConnectResponseMessage(go.GoClass):
|
|
|
5681
5705
|
self.handle = args[0].handle
|
|
5682
5706
|
_linksockslib.IncRef(self.handle)
|
|
5683
5707
|
else:
|
|
5684
|
-
self.handle = _linksockslib.
|
|
5708
|
+
self.handle = _linksockslib.linksocks_SocketManager_CTor()
|
|
5685
5709
|
_linksockslib.IncRef(self.handle)
|
|
5686
|
-
if 0 < len(args):
|
|
5687
|
-
self.Success = args[0]
|
|
5688
|
-
if "Success" in kwargs:
|
|
5689
|
-
self.Success = kwargs["Success"]
|
|
5690
|
-
if 1 < len(args):
|
|
5691
|
-
self.Error = args[1]
|
|
5692
|
-
if "Error" in kwargs:
|
|
5693
|
-
self.Error = kwargs["Error"]
|
|
5694
|
-
if 2 < len(args):
|
|
5695
|
-
self.ChannelID = args[2]
|
|
5696
|
-
if "ChannelID" in kwargs:
|
|
5697
|
-
self.ChannelID = kwargs["ChannelID"]
|
|
5698
5710
|
def __del__(self):
|
|
5699
5711
|
_linksockslib.DecRef(self.handle)
|
|
5700
5712
|
def __str__(self):
|
|
5701
5713
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5702
|
-
sv = 'linksocks.
|
|
5714
|
+
sv = 'linksocks.SocketManager{'
|
|
5703
5715
|
first = True
|
|
5704
5716
|
for v in pr:
|
|
5705
5717
|
if callable(v[1]):
|
|
@@ -5712,35 +5724,23 @@ class ConnectResponseMessage(go.GoClass):
|
|
|
5712
5724
|
return sv + '}'
|
|
5713
5725
|
def __repr__(self):
|
|
5714
5726
|
pr = [(p, getattr(self, p)) for p in dir(self) if not p.startswith('__')]
|
|
5715
|
-
sv = 'linksocks.
|
|
5727
|
+
sv = 'linksocks.SocketManager ( '
|
|
5716
5728
|
for v in pr:
|
|
5717
5729
|
if not callable(v[1]):
|
|
5718
5730
|
sv += v[0] + '=' + str(v[1]) + ', '
|
|
5719
5731
|
return sv + ')'
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
return _linksockslib.
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
@Error.setter
|
|
5733
|
-
def Error(self, value):
|
|
5734
|
-
if isinstance(value, go.GoClass):
|
|
5735
|
-
_linksockslib.linksocks_ConnectResponseMessage_Error_Set(self.handle, value.handle)
|
|
5736
|
-
else:
|
|
5737
|
-
_linksockslib.linksocks_ConnectResponseMessage_Error_Set(self.handle, value)
|
|
5738
|
-
@property
|
|
5739
|
-
def ChannelID(self):
|
|
5740
|
-
return go.uuid_UUID(handle=_linksockslib.linksocks_ConnectResponseMessage_ChannelID_Get(self.handle))
|
|
5741
|
-
def GetType(self):
|
|
5742
|
-
"""GetType() str"""
|
|
5743
|
-
return _linksockslib.linksocks_ConnectResponseMessage_GetType(self.handle)
|
|
5732
|
+
def GetListener(self, port):
|
|
5733
|
+
"""GetListener(int port) object, str"""
|
|
5734
|
+
return go.net_Listener(handle=_linksockslib.linksocks_SocketManager_GetListener(self.handle, port))
|
|
5735
|
+
def ReleaseListener(self, port, goRun=False):
|
|
5736
|
+
"""ReleaseListener(int port) """
|
|
5737
|
+
_linksockslib.linksocks_SocketManager_ReleaseListener(self.handle, port, goRun)
|
|
5738
|
+
def Close(self, goRun=False):
|
|
5739
|
+
"""Close()
|
|
5740
|
+
|
|
5741
|
+
Close closes all managed sockets immediately
|
|
5742
|
+
"""
|
|
5743
|
+
_linksockslib.linksocks_SocketManager_Close(self.handle, goRun)
|
|
5744
5744
|
|
|
5745
5745
|
|
|
5746
5746
|
# ---- Slices ---
|
|
@@ -5750,162 +5750,162 @@ class ConnectResponseMessage(go.GoClass):
|
|
|
5750
5750
|
|
|
5751
5751
|
|
|
5752
5752
|
# ---- Constructors ---
|
|
5753
|
-
def DefaultReverseTokenOptions():
|
|
5754
|
-
"""DefaultReverseTokenOptions() object
|
|
5755
|
-
|
|
5756
|
-
DefaultReverseTokenOptions returns default options for reverse token
|
|
5757
|
-
"""
|
|
5758
|
-
return ReverseTokenOptions(handle=_linksockslib.linksocks_DefaultReverseTokenOptions())
|
|
5759
5753
|
def DefaultServerOption():
|
|
5760
5754
|
"""DefaultServerOption() object
|
|
5761
5755
|
|
|
5762
5756
|
DefaultServerOption returns default server options
|
|
5763
5757
|
"""
|
|
5764
5758
|
return ServerOption(handle=_linksockslib.linksocks_DefaultServerOption())
|
|
5765
|
-
def
|
|
5766
|
-
"""
|
|
5767
|
-
|
|
5768
|
-
NewWSConn creates a new mutex-protected websocket connection
|
|
5769
|
-
"""
|
|
5770
|
-
return WSConn(handle=_linksockslib.linksocks_NewWSConn(conn.handle, label, logger.handle))
|
|
5771
|
-
def NewContextWithCancel():
|
|
5772
|
-
"""NewContextWithCancel() object
|
|
5759
|
+
def NewPortPoolFromRange(start, end):
|
|
5760
|
+
"""NewPortPoolFromRange(int start, int end) object
|
|
5773
5761
|
|
|
5774
|
-
|
|
5762
|
+
NewPortPoolFromRange creates a new port pool from a range of ports
|
|
5775
5763
|
"""
|
|
5776
|
-
return
|
|
5764
|
+
return PortPool(handle=_linksockslib.linksocks_NewPortPoolFromRange(start, end))
|
|
5777
5765
|
def NewPortPool(ports):
|
|
5778
5766
|
"""NewPortPool([]int ports) object
|
|
5779
5767
|
|
|
5780
5768
|
NewPortPool creates a new port pool from a slice of ports
|
|
5781
5769
|
"""
|
|
5782
5770
|
return PortPool(handle=_linksockslib.linksocks_NewPortPool(ports.handle))
|
|
5783
|
-
def NewPortPoolFromRange(start, end):
|
|
5784
|
-
"""NewPortPoolFromRange(int start, int end) object
|
|
5785
|
-
|
|
5786
|
-
NewPortPoolFromRange creates a new port pool from a range of ports
|
|
5787
|
-
"""
|
|
5788
|
-
return PortPool(handle=_linksockslib.linksocks_NewPortPoolFromRange(start, end))
|
|
5789
5771
|
def NewRelay(logger, option):
|
|
5790
5772
|
"""NewRelay(object logger, object option) object
|
|
5791
5773
|
|
|
5792
5774
|
NewRelay creates a new Relay instance
|
|
5793
5775
|
"""
|
|
5794
5776
|
return Relay(handle=_linksockslib.linksocks_NewRelay(logger.handle, option.handle))
|
|
5795
|
-
def
|
|
5796
|
-
"""
|
|
5797
|
-
|
|
5798
|
-
NewDefaultRelayOption creates a RelayOption with default values
|
|
5799
|
-
"""
|
|
5800
|
-
return RelayOption(handle=_linksockslib.linksocks_NewDefaultRelayOption())
|
|
5801
|
-
def NewLinkSocksServer(opt):
|
|
5802
|
-
"""NewLinkSocksServer(object opt) object
|
|
5777
|
+
def NewWSConn(conn, label, logger):
|
|
5778
|
+
"""NewWSConn(object conn, str label, object logger) object
|
|
5803
5779
|
|
|
5804
|
-
|
|
5780
|
+
NewWSConn creates a new mutex-protected websocket connection
|
|
5805
5781
|
"""
|
|
5806
|
-
return
|
|
5782
|
+
return WSConn(handle=_linksockslib.linksocks_NewWSConn(conn.handle, label, logger.handle))
|
|
5807
5783
|
def NewCLI():
|
|
5808
5784
|
"""NewCLI() object
|
|
5809
5785
|
|
|
5810
5786
|
NewCLI creates a new CLI instance
|
|
5811
5787
|
"""
|
|
5812
5788
|
return CLI(handle=_linksockslib.linksocks_NewCLI())
|
|
5789
|
+
def NewLinkSocksClient(token, opt):
|
|
5790
|
+
"""NewLinkSocksClient(str token, object opt) object
|
|
5791
|
+
|
|
5792
|
+
NewLinkSocksClient creates a new LinkSocksClient instance
|
|
5793
|
+
"""
|
|
5794
|
+
return LinkSocksClient(handle=_linksockslib.linksocks_NewLinkSocksClient(token, opt.handle))
|
|
5813
5795
|
def NewAPIHandler(server, apiKey):
|
|
5814
5796
|
"""NewAPIHandler(object server, str apiKey) object
|
|
5815
5797
|
|
|
5816
5798
|
NewAPIHandler creates a new API handler for the given server
|
|
5817
5799
|
"""
|
|
5818
5800
|
return APIHandler(handle=_linksockslib.linksocks_NewAPIHandler(server.handle, apiKey))
|
|
5801
|
+
def NewContextWithCancel():
|
|
5802
|
+
"""NewContextWithCancel() object
|
|
5803
|
+
|
|
5804
|
+
NewContextWithCancel creates a new context from the global context
|
|
5805
|
+
"""
|
|
5806
|
+
return ContextWithCancel(handle=_linksockslib.linksocks_NewContextWithCancel())
|
|
5819
5807
|
def DefaultClientOption():
|
|
5820
5808
|
"""DefaultClientOption() object
|
|
5821
5809
|
|
|
5822
5810
|
DefaultClientOption returns default client options
|
|
5823
5811
|
"""
|
|
5824
5812
|
return ClientOption(handle=_linksockslib.linksocks_DefaultClientOption())
|
|
5813
|
+
def NewDefaultRelayOption():
|
|
5814
|
+
"""NewDefaultRelayOption() object
|
|
5815
|
+
|
|
5816
|
+
NewDefaultRelayOption creates a RelayOption with default values
|
|
5817
|
+
"""
|
|
5818
|
+
return RelayOption(handle=_linksockslib.linksocks_NewDefaultRelayOption())
|
|
5819
|
+
def DefaultReverseTokenOptions():
|
|
5820
|
+
"""DefaultReverseTokenOptions() object
|
|
5821
|
+
|
|
5822
|
+
DefaultReverseTokenOptions returns default options for reverse token
|
|
5823
|
+
"""
|
|
5824
|
+
return ReverseTokenOptions(handle=_linksockslib.linksocks_DefaultReverseTokenOptions())
|
|
5825
|
+
def NewLinkSocksServer(opt):
|
|
5826
|
+
"""NewLinkSocksServer(object opt) object
|
|
5827
|
+
|
|
5828
|
+
NewLinkSocksServer creates a new LinkSocksServer instance
|
|
5829
|
+
"""
|
|
5830
|
+
return LinkSocksServer(handle=_linksockslib.linksocks_NewLinkSocksServer(opt.handle))
|
|
5825
5831
|
def NewSocketManager(host, log):
|
|
5826
5832
|
"""NewSocketManager(str host, object log) object"""
|
|
5827
5833
|
return SocketManager(handle=_linksockslib.linksocks_NewSocketManager(host, log.handle))
|
|
5828
|
-
def NewLinkSocksClient(token, opt):
|
|
5829
|
-
"""NewLinkSocksClient(str token, object opt) object
|
|
5830
|
-
|
|
5831
|
-
NewLinkSocksClient creates a new LinkSocksClient instance
|
|
5832
|
-
"""
|
|
5833
|
-
return LinkSocksClient(handle=_linksockslib.linksocks_NewLinkSocksClient(token, opt.handle))
|
|
5834
5834
|
|
|
5835
5835
|
|
|
5836
5836
|
# ---- Functions ---
|
|
5837
|
-
def
|
|
5838
|
-
"""
|
|
5839
|
-
return Slice_linksocks_LogEntry(handle=_linksockslib.linksocks_GetLogEntries())
|
|
5840
|
-
def SetLoggerGlobalLevel(level, goRun=False):
|
|
5841
|
-
"""SetLoggerGlobalLevel(int level)
|
|
5837
|
+
def CancelLogWaiters(goRun=False):
|
|
5838
|
+
"""CancelLogWaiters()
|
|
5842
5839
|
|
|
5843
|
-
|
|
5840
|
+
CancelLogWaiters cancels all waiting log listeners
|
|
5844
5841
|
"""
|
|
5845
|
-
_linksockslib.
|
|
5846
|
-
def
|
|
5847
|
-
"""
|
|
5842
|
+
_linksockslib.linksocks_CancelLogWaiters(goRun)
|
|
5843
|
+
def PackMessage(msg):
|
|
5844
|
+
"""PackMessage(object msg) []int, str
|
|
5848
5845
|
|
|
5849
|
-
|
|
5846
|
+
PackMessage converts a message to binary format
|
|
5850
5847
|
"""
|
|
5851
|
-
return go.
|
|
5852
|
-
def
|
|
5853
|
-
"""
|
|
5848
|
+
return go.Slice_byte(handle=_linksockslib.linksocks_PackMessage(msg.handle))
|
|
5849
|
+
def WaitForLogEntries(timeoutMs):
|
|
5850
|
+
"""WaitForLogEntries(long timeoutMs) []object"""
|
|
5851
|
+
return Slice_linksocks_LogEntry(handle=_linksockslib.linksocks_WaitForLogEntries(timeoutMs))
|
|
5852
|
+
def NewContext():
|
|
5853
|
+
"""NewContext() object
|
|
5854
5854
|
|
|
5855
|
-
|
|
5855
|
+
NewContext creates a new context from the global context
|
|
5856
5856
|
"""
|
|
5857
|
-
_linksockslib.
|
|
5857
|
+
return go.context_Context(handle=_linksockslib.linksocks_NewContext())
|
|
5858
5858
|
def NewLoggerWithIDAndLevel(id, level):
|
|
5859
5859
|
"""NewLoggerWithIDAndLevel(str id, int level) object
|
|
5860
5860
|
|
|
5861
5861
|
NewLoggerWithIDAndLevel creates a new zerolog.Logger with specified level that tags output with the given ID
|
|
5862
5862
|
"""
|
|
5863
5863
|
return go.zerolog_Logger(handle=_linksockslib.linksocks_NewLoggerWithIDAndLevel(id, level))
|
|
5864
|
-
def NewLoggerWithLevel(level, cb):
|
|
5865
|
-
"""NewLoggerWithLevel(int level, callable cb) object
|
|
5866
|
-
|
|
5867
|
-
NewLoggerWithLevel creates a new zerolog.Logger with auto-generated ID and specified level
|
|
5868
|
-
"""
|
|
5869
|
-
return go.zerolog_Logger(handle=_linksockslib.linksocks_NewLoggerWithLevel(level, cb))
|
|
5870
5864
|
def Background():
|
|
5871
5865
|
"""Background() object
|
|
5872
5866
|
|
|
5873
5867
|
Background returns a global context
|
|
5874
5868
|
"""
|
|
5875
5869
|
return go.context_Context(handle=_linksockslib.linksocks_Background())
|
|
5876
|
-
def
|
|
5877
|
-
"""
|
|
5870
|
+
def DebugLog(logger, msg, goRun=False):
|
|
5871
|
+
"""DebugLog(object logger, str msg)
|
|
5878
5872
|
|
|
5879
|
-
|
|
5873
|
+
DebugLog logs a debug message
|
|
5880
5874
|
"""
|
|
5881
|
-
_linksockslib.
|
|
5875
|
+
_linksockslib.linksocks_DebugLog(logger.handle, msg, goRun)
|
|
5876
|
+
def GetLogEntries():
|
|
5877
|
+
"""GetLogEntries() []object"""
|
|
5878
|
+
return Slice_linksocks_LogEntry(handle=_linksockslib.linksocks_GetLogEntries())
|
|
5882
5879
|
def NewLogger(cb):
|
|
5883
5880
|
"""NewLogger(callable cb) object
|
|
5884
5881
|
|
|
5885
5882
|
NewLogger creates a new zerolog.Logger with auto-generated ID
|
|
5886
5883
|
"""
|
|
5887
5884
|
return go.zerolog_Logger(handle=_linksockslib.linksocks_NewLogger(cb))
|
|
5888
|
-
def
|
|
5889
|
-
"""
|
|
5885
|
+
def CancelGlobalContext(goRun=False):
|
|
5886
|
+
"""CancelGlobalContext()
|
|
5890
5887
|
|
|
5891
|
-
|
|
5888
|
+
CancelGlobalContext cancels the global context
|
|
5892
5889
|
"""
|
|
5893
|
-
_linksockslib.
|
|
5894
|
-
def
|
|
5895
|
-
"""
|
|
5890
|
+
_linksockslib.linksocks_CancelGlobalContext(goRun)
|
|
5891
|
+
def NewLoggerWithID(id):
|
|
5892
|
+
"""NewLoggerWithID(str id) object
|
|
5896
5893
|
|
|
5897
|
-
|
|
5894
|
+
NewLoggerWithID creates a new zerolog.Logger that tags output with the given ID
|
|
5898
5895
|
"""
|
|
5899
|
-
return go.
|
|
5900
|
-
def
|
|
5901
|
-
"""
|
|
5896
|
+
return go.zerolog_Logger(handle=_linksockslib.linksocks_NewLoggerWithID(id))
|
|
5897
|
+
def NewLoggerWithLevel(level, cb):
|
|
5898
|
+
"""NewLoggerWithLevel(int level, callable cb) object
|
|
5902
5899
|
|
|
5903
|
-
|
|
5900
|
+
NewLoggerWithLevel creates a new zerolog.Logger with auto-generated ID and specified level
|
|
5904
5901
|
"""
|
|
5905
|
-
return go.
|
|
5906
|
-
def
|
|
5907
|
-
"""
|
|
5908
|
-
|
|
5902
|
+
return go.zerolog_Logger(handle=_linksockslib.linksocks_NewLoggerWithLevel(level, cb))
|
|
5903
|
+
def SetLoggerGlobalLevel(level, goRun=False):
|
|
5904
|
+
"""SetLoggerGlobalLevel(int level)
|
|
5905
|
+
|
|
5906
|
+
SetLoggerGlobalLevel sets the global log level for all loggers
|
|
5907
|
+
"""
|
|
5908
|
+
_linksockslib.linksocks_SetLoggerGlobalLevel(level, goRun)
|
|
5909
5909
|
def ParseDuration(s):
|
|
5910
5910
|
"""ParseDuration(str s) long, str
|
|
5911
5911
|
|