Giter VIP home page Giter VIP logo

liveproxy's Introduction

This is a proxy that lets you observe and modify packets as they come and go, with custom python code. There's no need to restart the proxy, just change the parser module (single function), it'll be reloaded automatically.

There's a lot of 'borrowed' code from LiveOverflow, go check him out.

exmaple

Getting started

git clone [this repo]
cp minecraft_replace_chat.py proxy.py # example parser that replaces the chat messages with a repeating string
python proxy.py
# start minecraft server (don't forget to disable online mode!)
(while true; do printf "time set 0\nweather clear\n"; sleep 10; done) | java -Xmx1024M -Xms1024M -jar server.jar nogui
# start minecraft and configure it to connect to 127.0.0.0:4000, the proxy should send all packets to 127.0.0.0:25565
# open up parser.py in your favorite editor and start playing

Basics

I have supplied a basic parser.py, look it up. It has a function called parse, with 3 arguments. The proxy expects to get the modified data returned.

In proxy.py you can change on which host you listen, which port and where to forward everything (again, host and port).

Enter 'quit' to easily kill everithing.

Example parser that just prints the data coming from the server

def parse(src_data, port, origin):
    if origin == 'server':
        print(src_data.hex())
    return src_data

Performace

Absolutely terrible! reload() is called on every single packet. To improve this you can pass some parameters to proxy.py, this will disable live reloading. Then by pressing r and enter you can trigger one manually.

liveproxy's People

Watchers

James Cloos avatar Stanislav Ch. Nikolov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.