YourByte.AI Developer
YourByte.AI Developer
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
I am back. I have created an HTTP website on port 80, but I am still getting the connection blocked by CloudFlare. Maybe I don't know how to configure my CloudFlare settings correctly. I tried an alternative service and successfully created a reverse proxy for my server. I will continue using CloudFlare for the website and configure the server backend using the alternative service. @HardlyWorkin' Thank you for your time and effort in trying to help me. 🙏🙏🙏
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
Unfortunately I am unable to start an http website on port 80 for some reason, Also I have to go to my day job. Thank you for trying to help me! When I will come back I will try to solve the issue and post the solution 💪 .
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
http://tunnel.domain.com:2053 ('domain.com' is a placeholder)
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
Yes
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
With tunnel. direct IPv4 works fine but switching to the tunnel URL gets blocked by CloudFlare
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
No description
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
I am trying to locate 'CloudFlare Spectrum', It's not showing up on my account dashboard
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
Yes
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
Oh it's not even reaching the server, I get no prints from the server at all so CloudFlare is blocking the access.
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
That is what the client is receiving from the server, the server doesn't print anything. Here are the scripts for context: server.py
import socket
import ssl
import os

HOST, PORT = '0.0.0.0', 2053

certfile_path = os.path.expanduser('~/Projects/Test-cf/cert/origin_cert.pem')
keyfile_path = os.path.expanduser('~/Projects/Test-cf/cert/private_key.key')

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((HOST, PORT))
sock.listen(1)

context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(certfile=certfile_path, keyfile=keyfile_path)

wrappedSocket = context.wrap_socket(sock, server_side=True)

print(f'Server is running on {HOST}:{PORT}...')

while True:
try:
client_socket, address = wrappedSocket.accept()
print(f'Connection from {address}')

try:
data = client_socket.recv(1024)
print(f'Received: {data.decode("utf-8")}')
if data:
response = 'Hello World'
client_socket.sendall(response.encode('utf-8'))
finally:
client_socket.close()
except Exception as e:
print(f'An error occurred: {e}')

wrappedSocket.close()
import socket
import ssl
import os

HOST, PORT = '0.0.0.0', 2053

certfile_path = os.path.expanduser('~/Projects/Test-cf/cert/origin_cert.pem')
keyfile_path = os.path.expanduser('~/Projects/Test-cf/cert/private_key.key')

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((HOST, PORT))
sock.listen(1)

context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(certfile=certfile_path, keyfile=keyfile_path)

wrappedSocket = context.wrap_socket(sock, server_side=True)

print(f'Server is running on {HOST}:{PORT}...')

while True:
try:
client_socket, address = wrappedSocket.accept()
print(f'Connection from {address}')

try:
data = client_socket.recv(1024)
print(f'Received: {data.decode("utf-8")}')
if data:
response = 'Hello World'
client_socket.sendall(response.encode('utf-8'))
finally:
client_socket.close()
except Exception as e:
print(f'An error occurred: {e}')

wrappedSocket.close()
client.py
import socket
import ssl

HOST, PORT = 'tunnel.domain.com', 2053 #'tunnel.domain.com' is a placeholder for my domain

ca_cert_path = 'cert/origin_cert.pem'

context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)

context.load_verify_locations(ca_cert_path)

context.check_hostname = True

with socket.create_connection((HOST, PORT)) as sock:
with context.wrap_socket(sock, server_hostname=HOST) as ssock:
# Send data
ssock.sendall(b"ping")

response = ssock.recv(1024)
print(f"Received: {response.decode('utf-8')}")
import socket
import ssl

HOST, PORT = 'tunnel.domain.com', 2053 #'tunnel.domain.com' is a placeholder for my domain

ca_cert_path = 'cert/origin_cert.pem'

context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)

context.load_verify_locations(ca_cert_path)

context.check_hostname = True

with socket.create_connection((HOST, PORT)) as sock:
with context.wrap_socket(sock, server_hostname=HOST) as ssock:
# Send data
ssock.sendall(b"ping")

response = ssock.recv(1024)
print(f"Received: {response.decode('utf-8')}")
I am unsure if my method of including the certification is correct, I had copied 'Origin Certificate' and the 'Private Key' into a text file and changed the file into .pem and .key
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
It's a very short python script I am testing this on, I can post it incase there is a method to include the certificate that I am not aware of.
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
Received: HTTP/1.1 400 Bad Request
Server: cloudflare
Date: Mon, 12 Feb 2024 08:03:05 GMT
Content-Type: text/html
Content-Length: 155
Connection: close
CF-RAY: -

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
Received: HTTP/1.1 400 Bad Request
Server: cloudflare
Date: Mon, 12 Feb 2024 08:03:05 GMT
Content-Type: text/html
Content-Length: 155
Connection: close
CF-RAY: -

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare</center>
</body>
</html>
This is what I receive, Without the 'Proxied DNS' I get a "Hello World"
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
By server log you mean the full '400 request error' or something specific within CloudFlare?
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
The same '400 bad request' error, I will grab the code 1 minute
36 replies
CDCloudflare Developers
Created by YourByte.AI Developer on 2/12/2024 in #general-help
Proxied DNS blocks server connections.
I created and tried to use 'Origin Certificate' on my hostname and server but it didn't help, Would it be beneficial If I shared the python server and client code I am using to diagnose if It's a code related issue?
36 replies