This Python script provides a simplified implementation of a VNC (Virtual Network Computing) server. It is a minimal example that supports a subset of VNC features.
To run the server:
- Ensure Python 3.x is installed on your system.
- Install the required Python package:
pip install -r requirements.txt
- Run the server script:
python vnc_server.py
By default, the server listens on all interfaces at port 5900 (0.0.0.0:5900
). You can modify the main()
function in vnc_server.py
to change these settings.
The server supports:
- Basic RFB protocol version negotiation.
- VNC Authentication (with a static password for demonstration purposes).
- Handling of
SetPixelFormat
andSetEncodings
messages. - Sending
FramebufferUpdate
messages with Raw and CopyRect encodings. - Handling of
KeyEvent
,PointerEvent
, andClientCutText
messages.
Note: The server's capabilities are rudimentary and may not perform optimally.
- The server has been tested with UltraVNC clients.
- Connections are established, but visual artifacts may appear on the screen.
- Mouse movement and click functionality are operational.
Due to its limited functionality, the current implementation may not correctly handle all aspects of screen updates and input events, potentially leading to incomplete functionality or the need for client reconnections.
This server is intended for educational and testing purposes and is not secure for production use. You may extend it with additional features and implement proper authentication and encryption for real-world applications.
This server is released under the MIT License, which is included in the repository. Modify and use it as needed, keeping in mind the security considerations mentioned above.
Always use secure practices when deploying servers like this in a production environment.