#networks

1 messages ยท Page 41 of 1

ember ledge
#

here

#

lets try it

#

no it wouldnt

#

i just verified it on my machine with a simple test script

ember ledge
#

actually

#

uh

#

oh right

#

wait

#

god this is confusing

#

one sec

#

ikr

#

Like

#

idk why this works but it does for all my other projects

#

where using a proxy is necessary

#

ok nvm it is possible to access https website

#

via http proxy

#

its just

#

harder

#

than just sending an HTTP request directly

#

wdym harder

#

more latency?

#

so i just pretended to be a proxy

#

on my machine

#
import requests

proxies = {
    "https": "http://127.0.0.1:4444"
    }

r = requests.get("https://www.example.com", proxies=proxies)
print(r.status_code)

#

and in the other terminal a simple HTTP listener on port 4444

#

right

#

if i try accessing http://www.examle.com here

#

then

#

thats what i get on the http listener side

#

just simple http request as it is (from the proxy's perspective)

#

but

#

if i try accessing https://www.examle.com

#

forgot about that one

#

god this stuff is confusing

#

so uh as a note, if you want to use sockets (go the hard way)

#

i need to use sockets ;-;l

#

and connect to https

#

final endpoint

#

then its not as simple as just

#

sending HTTP request directly

#

does that make sense

#

yeah

ember ledge
#

yes

#

there is a 30ms latency drop when i do from requests.get

#

and a lil less if i use request sessions

#

which in my case matters

#

uh

#

have you considered

#

this

#

i have not

#

uh

#

try

#

maybe

#

see whats the latency like

#

with it

#

alr ill compare rn

#
string= ("GET http://www.example.com/ HTTP/1.1\r\n"
"Host: example.com\r\n"
"Connection: close\r\n"
"\r\n")

conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("209.127.191.180",9279))
conn.send(string.encode())
item=conn.recv(4096)
print(item)
print("hi")
#

maybe Connection request header was mandatory, try and see if this gives anything other than 502

#

nope

#

still 502

#

edited

ember ledge
#

what did u edit?

#

changed the path

#

to the one i originally thought was invalid

#

OOOOOOOOOOOOO

#

O

#

O

#

OOOO

#

it worked

#

SHIT

#

so

#

only proxies accept this kind of path, usually it should always start with /

#

m y dumbass

#

as per HTTP documentation

#

so uh

#

thats something i forgot/didnt know about

#

tried ssl on http proxies ๐Ÿ’€

#

LOL

#

regular servers would give you 400 if you set path as:
GET http://www.example.com/ HTTP/1.1

instead of valid
GET / HTTP/1.1

#

but yeah proxies are not just regular servers

#

ok

#

so whats the issue now

ember ledge
#

ok

#

its possible

#

but once again

#

hard

#

yeah

#

the actual first request you send

#

to the proxy

#

is in cleartext

#

wait

#

yeah the CONNECT one

#

so

#

now time to try on roblopx

#

ok

#

so i have 502 on roblox

#

wait

#

try https

#

ok

#
string= ("GET https://www.example.com/ HTTP/1.1\r\n"
"Host: example.com\r\n"
"Connection: close\r\n"
"\r\n")

conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
conn.connect(("209.127.191.180",9279))
conn.send(string.encode())
item=conn.recv(4096)
print(item)
print("hi")
#

it worked

#

B)

#

well

#

will using https instead of http increase latency

#

thats all that matters

#

thats why im using sendall instead of send

#

i htink

#

uh

#

i dont think it would

#

thats really the only thing that matters

ember ledge
#

is same thing as calling send()

#

in a loop

#

isnt sendall tcp and send udp

#

but its for long

#

requests

#

only

#

you can just use send()

#

as your HTTP requests are small

ember ledge
#

fucking hell

#

where did i read that

#

https and http

#

only use TCP

#

yeah

#

ok

#

thats what i thought

#

idk where i saw that

#

ok

#

so https and httpo work

ember ledge
#

so requests.get

#

would first send a CONNECT

#

request

#

and only then

#

start sending actual request for that path you are interested in

#

unsure how this actually works

#

yeah

#

so

#

for my situation

#

i would connect once

#

and then send

#

instead of using requests.get to connect everytime

#

i could use request sessions

#

but that is still not as fast

#

and

#

idk abuot faster than requests

#

ill try it later

#

i think the only way to check if GET https://economy.roblox.com/v1/ works or not

#

is by sending

#

such a request

#

because basically it depends how proxy server

#

behaves

#

when it sees our HTTP request

ember ledge
#

even without CONNECT it would work

#

once again there are no guidelines for using webshare proxies directly via SOCKETS

#

so you can just try and see

ember ledge
#

is basically what i am saying, this might work

#

wait

#
blocksize = 1024 ** 2
# ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

sock = socket.socket()
sock.settimeout(5)
sock.connect(("209.127.191.180", 9279))

# sock = ssl_context.wrap_socket(
#     sock,
#     server_side=False,
#     do_handshake_on_connect=False,
#     suppress_ragged_eofs=False,
#     server_hostname="209.127.191.180")
# sock.do_handshake()
string= ("GET /v1/assets/63993845/resellers HTTP/1.1\r\n"
"Host: economy.roblox.com\r\n"
"Content-Type: text/html\r\n"
"X-CSRF-TOKEN: {}\r\n"
"cookie: {}\r\n"
"\r\n".format(i,formatted))
print(string)
elapsed=[]
for _ in range(20):
    t0 = time.time()
    sock.sendall(
        bytearray(string,"utf-8"))
    response, body = sock \
        .recv(blocksize) \
        .split(b"\r\n\r\n", 1)
    print(response)
    content_length = int(response \
        .split(b"content-length: ", 1)[1] \
        .split(b"\r\n", 1)[0])
    while content_length > len(body):
        body += sock.recv(blocksize)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)```
#

GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n"

#

try that

#

ok

#

got it

#

yessir

#

now

#

@ember ledge

#

lets say

#

i only wanted to receive the first blocksize

#

for every time i got a request from the server

#

how would i do that

#

like i just want the first block of a request

#

define block

#

just N number of bytes?

#

or first row?

#

yes

ember ledge
#

recv(N)

#

?

#

ik but i have a loop

#

then don't have a loop

#

and then when i recv more

#

i get the next part of the list

#

when i only want the first part

ember ledge
ember ledge
#

me

#

example response

#

so i get better understanding

#

ok

#

there

#

thats an example response

#
hi```
#

thats the first block

#

that i defined

#

blocksize = 1024 ** 2

#

is my blocksize

#

i dont reallly need the next blocks of data

#

well

#

i could just make my block size big enough to get all the data?

#

you want

#

to get the first dictionary

#

ending with }

#

correct

#

{"userAssetId":2348375210,"seller":{"id":2024206996,"type":"User","name":"BIoodgoons"},"price":6990,"serialNumber":null}

#

just this honestly

#

the top seller

#
first_block = ""

while True:
  c = conn.recv(1)
  if c == "}":
      break

  first_block = first_block + c

#

something like this?

ember ledge
#

yes

#

so you can retrieve this object

#

with resp.json()

#

oh

#

lol

#

forgot we arent using requests

#

hahah

ember ledge
#

and then json.loads(first_block) which should return a dictionary

ember ledge
#

then

#

i assume

#

yes it does

#

wouldnt .recv 1 at a time be slower?

#

seemingly

#

you can read like 100 bytes at once

#

and then just check if the ending curly bracket

#

is in those 100 bytes

#

if so then strip everything after, and append everything before to first_chunk

#

kind of thing

#

ok bet

#

lemme try that

#

i gotta go sleep now

#

ping me tmrw in case you need any more help

#

alr bro thanks for the help

#

big help

ember ledge
#

ill need your help tomorrow for a few other things i need and some oddities like why my program breaks when using a proxy when it works fine not and other thigns

#

but

#

thats tomorrows problem

ocean wraith
#

Hello I have a networking issue.

I have on my network:
my PC - 192.168.1.100
my Camera Dashboard - 192.168.8.199

subnet: 255.255.0.0

My camera and my pc does show up as connected on my router , however my camera dashboard is not responding
does anyone know if these settings are correct or whether I should change something?

ripe igloo
ember ledge
#

lets get started >:)

#
blocksize = 1024 ** 2
# ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)

sock = socket.socket()
sock.settimeout(5)
sock.connect(("209.127.191.180", 9279))

# sock = ssl_context.wrap_socket(
#     sock,
#     server_side=False,
#     do_handshake_on_connect=False,
#     suppress_ragged_eofs=False,
#     server_hostname="209.127.191.180")
# sock.do_handshake()
string= ("GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n"
"Host: economy.roblox.com\r\n"
"Content-Type: text/html\r\n"
"X-CSRF-TOKEN: {}\r\n"
"cookie: {}\r\n"
"\r\n".format(i,formatted))
print(string)
elapsed=[]
for _ in range(20):
    t0 = time.time()
    sock.sendall(
        bytearray(string,"utf-8"))
    response, body = sock \
        .recv(blocksize) \
        .split(b"\r\n\r\n", 1)
    # receive rest of body
    # print(response)
    content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    print(content_length)
    while content_length > len(body):
        body += sock.recv(blocksize)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)```
#

this code works without proxies

#

but gets this error on the proxy

#

@ember ledge

ember ledge
#

GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n"

#

this should only work with proxies

#

no idea how this works when you directly send a request to roblox

#

as to the error

#
    response, body = sock \
        .recv(blocksize) \
        .split(b"\r\n\r\n", 1)
#

i don't like that

#

just save the value of recv()

#

and print it

#

and only then split

#

to get more insight about the cause of the issue

prisma cobalt
#

wait, not yours, dw ๐Ÿ˜‚

ember ledge
#

didnt mentino that

ember ledge
#

@ember ledge

#

ok well my suggestions are above

#

but just remember that GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n" is only for proxy

#

if you talk directly to roblox or any other website

#

GET /v1/assets/63993845/resellers HTTP/1.1\r\n"

#

is the only format websites accept

ember ledge
#

right so heres my problem

#
 string= ("GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n"
"Host: economy.roblox.com\r\n"
"Content-Type: text/html\r\n"
"X-CSRF-TOKEN: {}\r\n"
"cookie: {}\r\n"
"\r\n".format(i,formatted))
print(string)
elapsed=[]
for _ in range(20):
    t0 = time.time()
    sock.sendall(
        bytearray(string,"utf-8"))
    response=sock.recv(blocksize)
    # receive rest of body
    print(response)
    # content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    # print(content_length)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)

print(sum(elapsed)/20)
print(elapsed)
#

this is all i really need

#

but when i go through the loop

#

i just get the rest of the data

#

i just want to farm the first block size

#

yk what i mean?

#

would i have to reconnect in that case?

ember ledge
#

so its one request and one response normally

#

now to read the response you use recv(N)

#

in order to not read the whole response and just first 100 bytes for example

#

you just recv(100) and then say "im out" and start with .connect() again

#

its one request and one response per one TCP connection

#

now you can send more than one requests and receives more than one response

#

on a single TCP connection

#

with http pipelining

#

or by setting Connection

#

header to keep-alive

#
import socket

payload = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: keep-alive\r\n\r\n".encode()
s = socket.socket()
s.connect(("www.example.com", 80))

# First request
s.send(payload)
print(s.recv(4086))

print()

# Second request
s.send(payload)
print(s.recv(4086))

#

@ember ledge

#

so it is possible to send multiple requests over one TCP connection, but you have to read the whole response

#

which doesn't fit your use case

ember ledge
ember ledge
#

the problem is it doesnt let me get another request over the same connection

ember ledge
ember ledge
#

ill try that out

viral sundial
#

can somehelp me with xmlrpc

sleek sand
#

i can't connect to my lapptop using tcp over the internet

#

send help

vestal epoch
#

try unplugging it and plugging it back in

ember ledge
sleek sand
#

no TCP

ember ledge
#

so both machines

#

you are trying to connect together

#

are regular ISP clients

humble siren
#

guys can someone help me a bit to create a list with a bunch of specific ips so i will use them to call a curl request ?

ember ledge
#

Frick

ember ledge
#

@ember ledge

#

sock = socket.socket()
sock.settimeout(5)
sock.connect(("209.127.191.180", 9279))

# sock = ssl_context.wrap_socket(
#     sock,
#     server_side=False,
#     do_handshake_on_connect=False,
#     suppress_ragged_eofs=False,
#     server_hostname="209.127.191.180")
# sock.do_handshake()
string= ("GET https://economy.roblox.com/v1/assets/63993845/resellers HTTP/1.1\r\n"
"Host: economy.roblox.com\r\n"
"Content-Type: text/html\r\n"
"X-CSRF-TOKEN: {}\r\n"
"cookie: {}\r\n"
"\r\n".format(i,formatted))
print(string)
elapsed=[]
for _ in range(20):

    t0 = time.time()
    sock.send(
        bytearray(string,"utf-8"))
    response=sock.recv(4096)+sock.recv(4096)
    # receive rest of body
    print(response)
    # content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    # print(content_length)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)```
bronze umbra
#

m 15 for nudes dm me in insta id dare_devil8t4w

ember ledge
#

@ember ledge its working

#

and latency is pretty solid too

#
for i in range(20):
    sock = socket.socket()
    sock.settimeout(5)
    sock.connect(("209.127.191.180", 9279))

    # sock = ssl_context.wrap_socket(
    #     sock,
    #     server_side=False,
    #     do_handshake_on_connect=False,
    #     suppress_ragged_eofs=False,
    #     server_hostname="209.127.191.180")
    # sock.do_handshake()

    # print(string)
    t0 = time.time()
    sock.send(
        bytearray(string,"utf-8"))
    response=sock.recv(4096)+sock.recv(4096)
    # receive rest of body
    # print(response)
    # content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    # print(content_length)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)
    try:
        sock.shutdown(2)
    except OSError:
        pass
    sock.close()```
#

anything i should chagne?

#

and also

#

im having trouble installing faster than requests

#

thge problem is i have to reconnect every time

#

which isnt good

#

and actually

#

its slower

#

i forgot to move the first time thing

blazing trail
ember ledge
#

it isnt lmao

blazing trail
#

good good

ember ledge
#

i just dont know how to fix it

#

this isnt a networking issue

#

but the package is networking related ig?

#

@ember ledge does faster-than-requests even support proxies in the first place?

ember ledge
#

but then you'd have to recv() whole response each time

#

the other option (which is what you are doing right now)

#

is only reading a small number of bytes

#

and then re-connecting again

#

though you are reading 4096 * 2 bytes now? when previously you only wanted like first 200-300 until you meet the first curly bracket?

ember ledge
#

and see which one is quicker

#

once again you are not utilising the main benefit of the second option, only reading N number of first bytes you need, instead of reading ALL from the response

ember ledge
#

I have to reconnect every time

#

Because itโ€™s a proxy

#

I think itโ€™s the proxy because when I do without I donโ€™t have to reconnect

white basalt
#

can anyone tell me

#

what it meant by

#

DNS in practice operates with a set of defined resources record types

#

im just learning the basics of DNS

white basalt
#

yea

#

and cname

#

i think i get it a little bit

#

its just hard to imagine where this process is going on rn

#

like they didnt explain this to me during the network layer in the OSI model

#

can anyone explain to me what a DHCP is in simple terms

ember ledge
#

that might be true

#

but when talking directly to a server this approach should work

#

wow

#

i was just abuot to ping u

ember ledge
#

to work

#

but why are you reading so many bytes?

#

and not by 100 bytes

#

in a loop

#

until you get }

#

nah ur right

#

i should do it 100 bytes at a time

#

but still the reconnect thing is annoying ngl

#

also

#

@ember ledge do u you happen to know how to install faster-than-requests?

#

it doesnt seem to work

#

or any other alternatives

#

do you think they would compare in speed to socket?

ember ledge
#

?

#

oh nah thats broken

#

here

#

well

#

first off it wouldnt even let me do that in pycharm

#

and when i installed it manually it gives me a nim error

#

seems like theres nothing i can do about that

#

im going to try some github issues that were solved to fix it

#

do you have any other recommendations for low latency requests alternatives?

#

ping me tmrw

#

i am heading out now

#

ah ok

cold monolith
#

Hi I am working with netfilter in Python in order to filterate the traffic of htts/http and ssl. I have knowledge of Iptables but unable to know where I can start from becuase I want to test the real time packets in order to analyze

#

Please anyone guide me

ember ledge
#

can anyone recommend a tutorial to turn my ubuntu server into a proxy server and connect it through python? thanks

ocean wraith
#

Hello does anyone know what might be a solution to this problem? I have a camera that has 192.168.8.199 ip setup in it's config and I can access the camera or change this static ip

finite dock
#

simplest solution is to check your wifi router to see if you can assign wifi/lan from the same dhcp pool

whole prawn
#

Is the sockets module safe?

#

By this Iโ€™m asking if itโ€™s naturally encrypted or do I have to do that myself

prisma cobalt
whole prawn
#

Alright, thank you

torpid berry
#

I have this code

import requests
session = requests.Session()
session.post(link, headers=Headers, data="{}")

What does 'data="{}"' send in the request? I need to emulate the request using C#, but I can't figure what the session sends as data

ember ledge
#

@ember ledge

#

im here

ember ledge
#

ok

#

u sure i need to connect every time?

#

doing that increases latency compared to requests

#

and also how do i install faster-than-requests

#

it just straight up does not work

ember ledge
ember ledge
#

hold on

#

about those faster requests library

#

why did you fail to install it?

#

what error message did you get

#

ok

ember ledge
#

this

#

actually

#

i cant even pip install it anymore]

#

@ember ledge

#

and on replit

#

i managed to install it

#

but thne i get this error

#
    return Nimporter.import_nim_code(fullname, path, library=False)
  File "/home/runner/SurefootedUnequaledDirectories/venv/lib/python3.8/site-packages/nimporter.py", line 828, in import_nim_code
    NimCompiler.compile_nim_code(
  File "/home/runner/SurefootedUnequaledDirectories/venv/lib/python3.8/site-packages/nimporter.py", line 558, in compile_nim_code
    cls.ensure_nimpy()
  File "/home/runner/SurefootedUnequaledDirectories/venv/lib/python3.8/site-packages/nimporter.py", line 270, in ensure_nimpy
    out, errors, _, _ = cls.invoke_compiler('nimble path nimpy'.split())
  File "/home/runner/SurefootedUnequaledDirectories/venv/lib/python3.8/site-packages/nimporter.py", line 245, in invoke_compiler
    process = subprocess.run(
  File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nimble'```
#

and when i try to pip install on pycharm i get this

errant bayBOT
#

Hey @ember ledge!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

ember ledge
#

so

#

yeah

ember ledge
#

@ember ledge

ember ledge
#

Uh

#

Tomorrow when I wake up

#

Iโ€™ve been working sry

toxic idol
toxic idol
#

are you sure they are?

#

I don't trust pictures from someone that can't set up a cam properly, I want to see actual addresses

#

cuz I've attemped to help people with "wireless" printers cuz they bought a WiFi extender that says it works for printers but printer wasn't even connected to it

ocean wraith
#

@toxic idol Thanks for help. 255.255.240 is my subnet that I setup on my router. and the ip's on the picture are the same as the ones in my network. But the issue still exists I'm not sure what do you mean by changing the ip manually as I dont have access to dasboard on my camera.

ember ledge
#

@ember ledgeaight

#

im available now

ember ledge
ember ledge
ember ledge
#

running

#

the code locally?

#

what machine are you using?

ember ledge
#

Iโ€™m using my own pc to test atm

#

But am planning on running it in aws

ember ledge
crude trellis
#

keep getting this error, im being assured that our api is up, not overloaded, and not refusing my requests when these happen, only happens about twice a week

#

any idea on how to fix or what would be causing it?

ember ledge
#

is online thing

#

isn't it

#

like online IDE

#

yeah

#

i tried it locally as well

chilly granite
#

help

#

help

ember ledge
#

before asking

#

what error did you get locally

#

when installing

#

that module

chilly granite
#

got damn help

#

please

ember ledge
#

i couldnt install locally

#

@chilly granite stop spamming and ask a question

ember ledge
#

o

ember ledge
chilly granite
#

@sharp crag

#

@sharp crag

sharp crag
#

wifi deadshit

ember ledge
ember ledge
#

@ember ledge pip install wheel

#

and try installing again

errant bayBOT
#

Hey @ember ledge!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

ember ledge
#

@ember ledge

ember ledge
#

this is why i dont use windows

#

no idea sry

tribal pewter
#

from ip route, can someone break down what this means in detail
10.24.92.0/24 dev eno3 proto kernel scope link src 10.24.92.40

tough pond
#

10.24.92.0/24 -> Networking Block that is being installed on the routing table
dev eno3 -> The Network interface on your computer. Dev means device and eno3 means that is the fourth ethernet port (the firsit is eno0) onboard. If it was an offboard adapter, It'll be ens3.
proto Kernel -> Means that this route was placed due to autoconfig from the OS perspective (anything placed directly on a config file, not by a cli command)

#

scope link -> means that the destination is a local network

#

src 10.24.92.40 - > is the gateway to the network range.

tough pond
tribal pewter
#

it's a subnet of something?

tough pond
#

Is an IP address Range.

#

/24 means that the network starts at 10.24.92.0 and goes to 10.24.92.255

tribal pewter
#

can you elaborate on "gateway to the network range"?

tough pond
#

Basically, this line says:" To reach anyone inside 10.24.92.0/24, or between 10.24.92.0 to 10.24.92.255, you need to get across 10.24.92.40.

tribal pewter
#

ahh I see

tough pond
#

Does that make any sense to you?

tribal pewter
#

yeah, that makes sense

#

10.24.92.40 is the ip of eno3 and to reach that network range, we need to go through eno3

#

like if we were to ssh, we would go to that ip

#

through eno3

ember ledge
#

print

#
print("HI")```
#

@errant bay

#

,run py print("HI")

#

fuck

ember ledge
#

@ember ledge

#

!e

errant bayBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

ember ledge
#

!e

print("hey")
errant bayBOT
#

@ember ledge :white_check_mark: Your eval job has completed with return code 0.

hey
marble wharf
#

!e
print ("Groovy")

ember ledge
#

!e

while True:
print("COOL")```
#

facrs

#

!e

while True:
 print("COOL")```
#

๐Ÿ˜–

toxic karma
#

Hi , I wanted some resources/techniques on finding the actual IP addresses behind a proxy/VPN IP address. Its for a project Im working for, not getting much info regarding this.

frozen drum
ember ledge
#

in terms of finding an IP of a user hiding behind VPN or proxy, not possible unless the actual proxy or vpn go ahead and leak that info, or they get hacked

#

in terms of finding an IP of a server hiding behind front-end proxy/cache, that is possible

distant cairn
#

could someone help me with networking?

ember ledge
#

Any other fast alternatives?

#

I might have to use something other than sockets since u have to reconnect every time with proxies

tough pond
white basalt
#

can anyone shorten this ipv6 address

#

its just a practice

#

not real

#

if anyone do know just ping me or pm me

marble slate
#

i get this error ```py
Traceback (most recent call last):
File "main.py", line 9, in <module>
json_object = json.loads(str(a.json()))
File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

with this code 

import os
import requests
import json

a = requests.get("https://www.roblox.com/users/profile/playergames-json?userId=261")

#print(a.json())

json_object = json.loads(str(a.json()))

print(json_object)

print(json.dumps(json_object, indent=1))


how do i fix?
thorn stratus
#

sounds like your json is broken

#

what did printing it get you?

#

also why are you converting it to json then to a string and then back to json

stable quarry
#

hi

toxic karma
stable quarry
#

can someone help me with how to create packets using scapy

stark jolt
#

I'm starting a Minecraft server DDoS protection service, I know how to write the API etc, and what I want to do. I just want a helping hand as the task is quite large. If anybody would like to help me, feel free to pm me ๐Ÿ™‚

cobalt raptor
stark jolt
#

Like a web panel?

#

@cobalt raptor

#

If you would be able to make a web panel that runs off the API that would be amazing.

#

If not, just a typical website would be handy ๐Ÿ™‚

cobalt raptor
#

both

#

the panel could be made with vue js

#

@stark jolt

stark jolt
#

Sick, I'll pm you a link to the discord server

ember ledge
ember ledge
#

Suppose in the case of a cybercrime they would have some method to track back. - well as i mentioned if the VPN/proxy gets hacked or leaked from inside, then sure

#

but it's not supposed to happen

gray lagoon
#

Hello Guys, Is there any free hosting service like pythonanywhere but has free ALWAYS ON tasks?

ember ledge
#

The thing is

#

I donโ€™t have apt

#

On these systems

#

Iโ€™m using

ember ledge
ember ledge
#

man

#

so the error message mentions this

#

nimble seems to be an alternative for pip

#

of some sort

ember ledge
#

any possibility to rent a 4 dollar linux server

#

for a month

#

I do

#

Btw

#

or perhaps install linux on a USB

#

I use an aws server

#

Or I could use an Ubuntu vm

#

i mean if you already have an ec2

#

on amazon then why not use that one

#

what linux distro is it running?

#

if linux at all

#

ubuntu

#

server

ember ledge
#

hey, im trying to scrape this site:
https://zillow.com/homes/Washington,-DC_rb
and it works fine with postman, but when i try to do a get request in python im getting this error:
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

#

anyone got a clue how i can fix this?

hoary blaze
#

I have a prompt on a site that needs some text to be input in, how can i make that my python script inputs the text in the prompt

ember ledge
#

so its basically caused by third party

#

library

#

that faster than requests uses

#

uh let me find some alternatives

#

@ember ledge

#

urllib3 is being suggested a lot so try that one

#

considering requests is built on top of that

ember ledge
ember ledge
#

Unless there is some way to keep a connection open over a proxy

#

In socket

ember ledge
#

the whole body on each request

#

i already posted the code above at some point

ember ledge
ember ledge
#

I tried that

#

Didnโ€™t work

#

what was the code

#

again?

#

can you post it

#

Uh

#

Iโ€™m not at my pc lemme see if I posted it

#

@ember ledge itโ€™s because itโ€™s a proxy

#

I donโ€™t think u can keep it open even if u read the entire request

elder mason
#

hey Folks ,
i was tryna to use sys.argv with socket connect but it failed

s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(sys.argv[1],port)
s.connect(sys.argv[1],port)
TypeError: socket.connect() takes exactly one argument (2 given)
ember ledge
#

.connect() takes a tuple

#

(host, port)

#

as a single parameter

#

s.connect(("www.google.com", 80))

ember ledge
#

@ember ledge is it possible to get data again without reconnecting while through a proxy?

ember ledge
#

as i said

#

give me your code again

#

or just use the one

#

i posted before

ember ledge
#
for i in range(20):
    sock = socket.socket()
    sock.settimeout(5)
    sock.connect(("209.127.191.180", 9279))

    # sock = ssl_context.wrap_socket(
    #     sock,
    #     server_side=False,
    #     do_handshake_on_connect=False,
    #     suppress_ragged_eofs=False,
    #     server_hostname="209.127.191.180")
    # sock.do_handshake()

    # print(string)
    t0 = time.time()
    sock.send(
        bytearray(string,"utf-8"))
    response=sock.recv(4096)+sock.recv(4096)
    # receive rest of body
    # print(response)
    # content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    # print(content_length)
    # print(body)
    # print(response)
    t1 = time.time()
    elapsed.append(t1-t0)
    time.sleep(1)
    try:
        sock.shutdown(2)
    except OSError:
        pass
    sock.close()```
#

@ember ledge

ember ledge
#

@ember ledge

#

this kind of logic

sour bough
ember ledge
#

@ember ledge ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

#

this happens when trying to stay connected through the proxy

ember ledge
#

Hey, anyone would like to join me for a matrix (messaging protocol not the movie) inspired project?

ember ledge
ember ledge
#

Authorization header?

#

wasn't it mentioned in the docs for your proxy provider

ember ledge
#

i think its being aborted on your side not on proxy's side

#

well

#

the thing is

#

i can use request sessions just fine

#

which might just be my solution for now

ember ledge
#

its not the one

#

where you re-use the same connection to send multiple requests

#

oo

#

ok

#

wait

ember ledge
#

thats the problem

#

just dont overcomplicate things

#

use

#

foooooooook

#

no

#

    response=""
    while True:
      data = sock.recv(512)
      if (len(data) < 1):
          break
      
      response = response + data.decode()

#

to read whole resp

#

thats not the right code

#

i do read the whole thing

#

lemme just c opy and paste it

#

!paste

errant bayBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

ember ledge
#

@ember ledge

ember ledge
#

header

#

yes

#

in your HTTP request

#

i recently added it

#

and tested it

#

it says win error

#

is that a windows issue?

#

no what matters is the actual message

#

in the errror

#

i assume sock.send

#

breaks

#

on the second loop iteration

#

it coould be that your proxy does not support it

#

no

#

on the 3rd loop iteration

#

but my thing is why would it work for sessions

#

so first 2 work fine?

#

you are actually able to send 2 requests via the same TCP connection?

ember ledge
#

no

#

because

#

as the proxy here doesnt seem to support it

#

wait

#

actually

#

lemme test taht proxy on session

#

no that proxy supports it

ember ledge
#

i tested it

#

with a proxy?

#

nah

#

instead of proxy

#

eyah

#

eyah

#

yeah

#

thats the thing

#

it doesnt work with the proxy

#

so it must be the proxy not supporting it

#

and i tested this proxy on request sessions

#

and that works fine

#

once again

#

you wouldnt be able to tell

#

if multiple requests are sent over same TCP connection

#

with sessions

#

oo ok

#

if the proxy doesnt support it

#

it would still work and not raise

#

errors

#

sessions will just send one requests

#

per TCP connection

ember ledge
#

they are mostly for storing cookies across whole session

#

well it does reduce latency

#

it keeps the connection open

#

how do you know

#
209.127.191.180
0.37s elapsed for requests.Session() no.
200
209.127.191.180
0.08s elapsed for requests.Session() no.
200
209.127.191.180
0.08s elapsed for requests.Session() no.
200
209.127.191.180
0.07s elapsed for requests.Session() no.
200
209.127.191.180
0.08s elapsed for requests.Session() no.

Process finished with exit code -1

#

the connections are cached for later use

#

on sessions

#

same proxy

#

i think im just going to give up on scraping with socket and just use sessions

#

but i still probably should use sessions for the post request

#

@ember ledge how long can i keep aconnection open?

ember ledge
#

ok i found the issue

#

@ember ledge

ember ledge
#

can you just try response = sock.recv(8000)

#

inside of each loop iteration

#

and see if it works

#

first

ember ledge
#

in one go

#

and the thing is

#

i still get the same error

#

so

#

i do that right

#

8000 bytes

#

but no matter what i cant read the entire thing

#

and i still get the same error

#

@ember ledge

#

againnnn

#

i did the reading by smaller N

#

proxies

#

again

#

try it

#

ok

#

just adapt the code

#

to proxy

#
elapsed = []
sock = socket.socket()
sock.settimeout(5)
sock.connect(("209.127.191.180", 9279))

for i in range(20):
    # sock = ssl_context.wrap_socket(
    #     sock,
    #     server_side=False,
    #     do_handshake_on_connect=False,
    #     suppress_ragged_eofs=False,
    #     server_hostname="209.127.191.180")
    # sock.do_handshake()

    # print(string)
    t0 = time.time()
    sock.send(
        bytearray(string, "utf-8"))

    response = ""
    response = sock.recv(20000)

    # receive rest of body
    # print(response)
    # content_length=int(response.split(b"Content-Length: ")[1].split(b"\r\n")[0])
    # print(content_length)
    # print(body)
    print(response)

    t1 = time.time()
    elapsed.append(t1 - t0)
    time.sleep(1)

try:
    sock.shutdown(2)
except OSError:
    pass

sock.close()

#

@ember ledge

#

right

#

what about this

#

well

#

it was 8000

#

?

#

but urs is different

#

lemme try it

#

yeah because reading 8K bytes

#

is not smart

#

usually we do it in smaller chunks

ember ledge
#

well

#

@ember ledge basically

#

i removed the if not data part

#

so i can loop it

#

an

#

and

#

same error

ember ledge
#

what

#

what are you talking about

#

did my code not work with the proxy

#

or what

#

oh

#

nah it didnt

#

so

#
elapsed = []
sock = socket.socket()
sock.settimeout(5)
sock.connect(("209.127.191.180", 9279))

for i in range(20):
    # sock = ssl_context.wrap_socket(
    #     sock,
    #     server_side=False,
    #     do_handshake_on_connect=False,
    #     suppress_ragged_eofs=False,
    #     server_hostname="209.127.191.180")
    # sock.do_handshake()

    # print(string)
    t0 = time.time()
    sock.send(bytearray(string, "utf-8"))

    response = ""
    headers_done = False
    cl_found = False

    # Getting everything before the body
    while not headers_done:
        data = sock.recv(50).decode()

        # Finding Content-Length
        if not cl_found:
            r = re.search("content-length: ([\d]+)\\r\\n", response.lower() + data.lower())
            if r:
                body_length = int(r.group(1))
                cl_found = True

        # Finding beginning of the body
        r_2 = (response + data).find("\r\n\r\n")
        if r_2 > -1:
            print("yes")
            # body_start = len(response) + r_2 + 4
            headers_done = True
            body_bytes_read = len(
                response + data) - r_2 - 4  # In case we accidentally read some bytes already from the body
            body_length = body_length - body_bytes_read

        # if not data:
        #     break

        response = response + data

    # Getting body
    data = sock.recv(body_length).decode()
    response = response + data

    print(response)

    t1 = time.time()
    elapsed.append(t1 - t0)
    time.sleep(1)

try:
    sock.shutdown(2)
except OSError:
    pass
#

copy and pasted it

#
        #     break
#

i removed this

#

dont remove this

ember ledge
#

defeating the purpose

#

ye

#

nah

#

its supposed to break out

#

of the while true

#

loop

#

not the main loop

#

but its alright

ember ledge
#

the sample code i gave works even if you comment

#

out

#

e

#

it doesnt with a proxy

ember ledge
#

wait

#

o

#

it just breaks out of while not headers_done

ember ledge
#

honestly

#
for i in range(20):
    # sock = ssl_context.wrap_socket(
    #     sock,
    #     server_side=False,
    #     do_handshake_on_connect=False,
    #     suppress_ragged_eofs=False,
    #     server_hostname="209.127.191.180")
    # sock.do_handshake()

    # print(string)
    t0 = time.time()
    sock.send(bytearray(string, "utf-8"))

    response = ""
    headers_done = False
    cl_found = False

    # Getting everything before the body
    while not headers_done:
        data = sock.recv(50).decode()

        # Finding Content-Length
        if not cl_found:
            r = re.search("content-length: ([\d]+)\\r\\n", response.lower() + data.lower())
            if r:
                body_length = int(r.group(1))
                cl_found = True

        # Finding beginning of the body
        r_2 = (response + data).find("\r\n\r\n")
        if r_2 > -1:
            print("yes")
            # body_start = len(response) + r_2 + 4
            headers_done = True
            body_bytes_read = len(
                response + data) - r_2 - 4  # In case we accidentally read some bytes already from the body
            body_length = body_length - body_bytes_read

        if not data:
            break

        response = response + data

    # Getting body
    data = sock.recv(body_length).decode()
    response = response + data

    print(response)

    t1 = time.time()
    elapsed.append(t1 - t0)
    time.sleep(1)

try:
    sock.shutdown(2)
except OSError:
    pass```
#

what is the error

#

you are getting now?

#

ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

#

its actually different

#

it went from 10053

#

to 10054

#

what did u change here tho?

#

uh so basically we were reading

#

more than we should have

#

which was my mistake

#

i had to parse each data in smaller chunks

#

and find content-length

#

yes

#

actually

#

that was my original code

#

uh

#

it did somethign like that

#

uh

#

well sry about that then

ember ledge
#

well

#

honestly

#

no

#

no

#

like

#

a while ago

#

and it still didnt work

ember ledge
ember ledge
#

hmmm maybe i have to tell hte proxy to keep the connection open?

#

idk

#

so same code works for www.example.com but doens't work when you change host to proxy

#

try a different proxy?

#

so proxy doesnt support multiple TCP requests over same connection is my guess

#

uh

#

sure

#

ok

#

questioon

#

how to do verificaiton

#

of the proxy

#

like this one has user and pass

#

so even without specifying connection header it defaults to Connection: keep-alive when using http/1.1

#

but yeah usually you do it via that header

#

not by any other means

ember ledge
#

of your proxy provider

#

heh

#

uh

#

its usually just an Authorization header

#

oo

#

ok

#

that you add to all the other headers of your request

ember ledge
#

i highly doubt they have docs about that

#

so its not an issue on your end

#

no more

ember ledge
#

docs for requests

#

i saw them

#

before

#

OO

#

i meant for my proxy provider

#

right

#

thats what i am talking about

#

your proxy provider has docs

#

about how to use their proxy with requests

#

i promise u they dont

#

and it mentions autherization headers

#

its a new one?

#

wasnt it

#

proxy

#

uh

#

something

#

before

#

it was webshare

#

before

#

right

#

webshare

#

has docs

#

would it be the same for both proxies?

#

?

#

it depends on the proxy

#

sometimes one proxy could require something like ProxyAuth header

#

while the other one requires AuthorizationForProxy

#

actually

#

ill ask the ashburnproxies guy

#

wait

ember ledge
#

would socks proxies support sending multiple tcp over 1 connection

#

api token of sorts

ember ledge
ember ledge
#

socks proxy supports all types of application level protocols

#

HTTP, FTP, SMTP

#

while http proxy only supports, well, HTTP

ember ledge
ember ledge
#

as well

#

bet

#

i asked

#

hes replying to me in real time

#

Proxy-Authenticate: Basic realm="Please enter username and password"

#

i found this in the response headers when not giving authentication @ember ledge

#

the guy doesnt seem to understand my question

#

im telling him im trying to authenticate through the headers

#

but

#

he doesnt know what that means?

#

idfk

ember ledge
#

your average support representative

ember ledge
#

he owns the entire thing

#

LOL

#

hahaha

#

im literally reading that now

#

thats the response header

#

thats the request

ember ledge
#

well

#

he says it should work

#

credentials is what you are missing

ember ledge
#

i assume the value should be username,password and base64 encoded

#

dies

#

close enough

#

its :

#

not comma

#

in-between

#

but yeah that should be it

#

"Authorization: user:pass"
?

#

@ember ledge ^

#

base64 encode user:pass and add Basic

#

Authorization: Basic base_64_encoded

ember ledge
#

"Authorization: user,pass Basic base_64_encoded"

#

@ember ledge

ember ledge
#

cred = "user:pass"

encoded = base64(cred)

final = "Authorization: Basic " + encoded
#

@ember ledge

#

pseudo code

#

just think of user:pass as your real credentials

ember ledge
#

you silly goose

ember ledge
#

Fr

white sage
#

Hi, do you know a library to do traversal-nat ?

ember ledge
#

hi

#

why can I go to some sites with the tor browser but as soon as I try to do a direct get request with python request over tor proxy on the same site (with the same headers) I get a 403 error

ember ledge
ember ledge
ember ledge
#

uh

ember ledge
#

with python request

#

post your code

#

!paste

errant bayBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

ember ledge
#

with this website it work but not on all site

#

s.proxies = {'http': 'socks5://localhost:9050', 'https': 'socks5://localhost:9050'}

#

you had a typo

#

what ?

#

ah never mind

#

apparently socks5h is a thing

#

have you tried socks5://

#

nevertheless

#

instead of socks5h://

#

i dont see a difference

pulsar hawk
#

What is the roadmap of learning networking?

tough pond
ember ledge
#

@ember ledge

#

thanks for the help dude