barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
527 stars 75 forks source link

Proxies join? #169

Open OnTheCodeOfficial opened 1 year ago

OnTheCodeOfficial commented 1 year ago

So how can i join the bot with the proxy?

Here is the code for bot to join it's worked but i wonder how to use proxy to connect the server with it ? Maybe in the line factory.connct("host","port") ? like proxy = {http:'http://proxy:port'} or socks proxy stuff and use it to join server instead local machine

I read the class ClientFactory inside the module quarry.net.client but still confuse about this image

Do i need to overwrite library for that or it build with itself ?

Here is example of default join code

from twisted.internet import defer, reactor
from quarry.net.client import ClientFactory, ClientProtocol
from quarry.net.auth import Profile
from quarry.net.auth import OfflineProfile

class ExampleClientProtocol(ClientProtocol):
    pass
class ExampleClientFactory(ClientFactory):
    protocol = ExampleClientProtocol

@defer.inlineCallbacks
def main():
    print("logging in...")
    # profile = yield Profile.from_credentials("Jimmy001")     #For online real official account
    profile = OfflineProfile("Jimmy")  # For offline account
    factory = ExampleClientFactory(profile)
    print("connecting...")
    factory = yield factory.connect("localhost", 25565)
    print("connected!")

if __name__ == "__main__":
    main()
    reactor.run()
davidawesome02 commented 1 year ago
  1. you can port forward that port and use the ip or get a domain.
  2. you can overwrite the library in location (too complex because diffrent verison) or you can import it from a folder just git clone and load it
  3. msg me on discord and I can try to explain more, but a proxy is prob not what you want (davidawesome01#3886)