A secure WebSocket server for checking software versions using external search services and AI analysis.
- 🔒 End-to-end encryption using ECC (Elliptic Curve Cryptography)
- 🌐 WebSocket communication protocol
- 🔑 User management system with UUID-based authentication
- 🔍 Integrated with Yandex Search, Safe Browsing, and GPT APIs
- 📁 Environment-based configuration
- 📄 JSON configuration storage for users
- Clone the repository:
git clone https://github.com/NotBalds/swuc-server.git
cd swuc-server- Install dependencies:
pip install -r requirements.txt- Set up environment variables (create
.envfile):
SWUC_SERVER_ADDR=localhost
SWUC_SERVER_PORT=8765
YANDEX_FOLDER_ID=your_folder_id
YANDEX_SEARCH_API_KEY=your_search_key
YANDEX_SAFE_BROWSING_API_KEY=your_safety_key
YANDEX_GPT_API_KEY=your_gpt_keypython src/main.pyOnce the server is running, use these commands in the console:
help - Show available commands
new - Create new user (generates UUID and keys)
list - List registered users
del <uuid> - Delete a user
exit - Shutdown server
When creating a new user (new command), the server:
- Generates UUID for the client
- Creates
users/<uuid>.jsonwith connection details - Stores server-side configuration in
users.json
Client configuration includes:
- WebSocket URL
- Client secret key
- Server public key
- UUID identifier
-
Client Request:
- Encrypts software name list using server's public key
- Base64 encodes and sends via WebSocket
-
Server Processing:
- Validates UUID
- Decrypts request using client-specific private key
- Performs web search and content analysis
- Encrypts response with client's public key
- Returns base64-encoded result
-
Response Format:
[
{
"error": null,
"metadata": {
"analysis_time": "2023-12-20T00:00:00Z",
"urls_analyzed": 5,
"urls_searched": 5
},
"name": "python",
"sources": [
"https://www.python.org/downloads/",
"https://www.python.org/downloads/windows/",
"https://www.python.org/?downloads=",
"https://python.en.uptodown.com/windows/download",
"https://rdil.github.io/pythondotorg-downloads-page-prototype/"
],
"version": "3.13.3"
}
]- 🔐 ECC Encryption using
eciespylibrary - 🔑 Unique key pair per user
- 🛡️ Base64 encoding for all network communications
- Python 3.8+
- websockets
- ecies
- python-dotenv
- yandex APIs (search, safe browsing, GPT)
- Fork the repository
- Create feature branch (
git checkout -b feature/fooBar) - Commit changes (
git commit -am 'Add some fooBar') - Push to branch (
git push origin feature/fooBar) - Create new Pull Request