-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.py
More file actions
49 lines (33 loc) · 880 Bytes
/
server.py
File metadata and controls
49 lines (33 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from packs.settings import *
import socket
from packs import *
from packs.packets import*
from os import system
#import term
USERS=0
heart=bytes(f"GET /heartbeat.jsp?port={PORT}&max={MAX}&name={NAME}&public={PUBLIC}&version=7&salt={SALT} HTTP/1.1\r\nHost:www.classicube.net\r\n\r\n",encoding="utf-8")
#server thinghs
#s is server
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#connect
s.connect(("classicube.net",80))
#send the hertbeat
s.sendall(heart)
# get the responce
print(str(s.recv(3000), 'utf-8'))
#####SERVER#####
server=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server.bind(('',PORT))
server.listen(5)
on=True
##server main loop
while on:
#accept connections
(client, addr) = server.accept()
print(client)
#print(str(client.recv(10), 'utf-8'))
client_server(client)
#####CLOSE THE SERVERS###
server.close()
s.close()
system('clear')