all 23 comments

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (22 children)

Oh boy http server logs for an onion site, thank you

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (3 children)

i am finally getting my webserver working.. i have wanted this for the longest time..

you see, with a custom server i can choose to just simply DISREGARD ALL OF THE CROSS ORIGIN BULLSHIT, ETC.. AND you just aint gonna get a directory listing of my webserver... BECAUSE I DIDNT INCLUD THAT BULLSHIT INTO MY CODE..

my webserver will ONLY DO WHAT I TELL IT TO DO.. there wont be any mystery configuration parameters for me to carelessly overlook..

this is what my log is suppsoed to look like:

https://files.catbox.moe/2sp5np.txt

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (2 children)

Heres mine

Finished dev [unoptimized + debuginfo] target(s) in 0.30s
 Running `target/debug/phooey`

😋 I 14.43 actix_web:logger > 127.0.0.1 "GET / HTTP/1.1" 200 307 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36" 0.000439

😋 I 14.51 actix_web:logger > 127.0.0.1 "GET /favicon.ico HTTP/1.1" 304 0 "http://localhost:8000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36" 0.000586

Its in Rust

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

what is the domain of your website?

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

its just running locally on my machine while I develop it, it doesn't have a domain

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (16 children)

do you know what else is sorta cool about my developing a custom web server?

my webserver generates the html and javascript for my site.

most web sites require a web server AND a web application... like the chat bullshit at saidit, it omg has to jump down and use nodejs... I WOULD NEVER USE NODEJS.

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (15 children)

You don't even need to generate javascript if you don't want, you can do all the processing server side and just inject the dynamic content into the HTML before serving it. Also yes I would never use nodejs

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (14 children)

a webpage can only do dynamic processing by using javascript or by using some other programming thing that executes inside of the browser.

you CAN NOT produce a dynamic chat by using server side code alone.

period.

check around.

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (13 children)

Yes, I realize you can't do chat like that, but you could do all of the other saidit features like loggin in, posting and commenting without a single line of JS

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (10 children)

right now, i need to know how to produce a dynamically live web app... kinda like what i would use to produce a live TRADING CHART with dynamically changing prices, etc.. and a dynamic chart...

i basically know how to do this.. i just need to find the most low level way wth javascript.. i think i want to use either xmlhttprequest or fetch.. i am nto sure which.. i am reading that xmlhttprequest may be obsolete.. so i want to be careful to not select a programming method that will become deprecated later..

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (9 children)

Use the fetch API, you are right that xmlhttp is obsolete.

const json = JSON.stringify(obj);

const res = await fetch('http://127.0.0.1:8000/register', 
{
  method: "post",
  headers: 
  {
    "Content-Type": "application/json",
  },
  body: json,
})

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (8 children)

ok, i really appreciate that, mr hongkongphooey..

but that code doesnt really make sense.

for example, the "Content-type: text/html\r\n\r\n" is part of the response that is returned from the web server... it has nothing to do with the request, just fyi... unless you would care to enlighten me..

just fyi, you can go to a shell and type "telnet google.com 80" and then type "GET / HTTP/1.0\n\n" and the web server will return your website html and javascript which will begin with a "Content-type: text/html\n\n"

anyways, my webserver is working now... but i need to clean it up a bit..

and i now need to get my code in place that will allow my browser to make regular website requests using either xmlhttprequest or fetch...

i am actually expecting that xmlhttprequest is going to be fine and i can really believe that they will actually put that code obsolete and non functioning... i am guessing that there are way too many applications that use that xmlhttprequest to put it compeltely out of commission.

i will keep you posted.

[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (7 children)

for example, the "Content-type: text/html\r\n\r\n" is part of the response that is returned from the web server... it has nothing to do with the request, just fyi... unless you would care to enlighten me.

That particular example is sending the registration form fields as JSON in the body of the request. JSON is the most common format to send data between the client and server when you have javascript to deal with.

Fetch should be faster than XHR most of the time because it decodes JSON off thread being promise based. XHR will work fine, it's still supported in browsers, but fetch is a better performing API

[–]jingles[S] 1 insightful - 2 fun1 insightful - 1 fun2 insightful - 2 fun -  (6 children)

i dont need json... i am old school... my preference is similar to how data is received in an http response, "variablename: value"

i am quite happy with something like that.. i just want to be able to request a webpage and to receive it;s header and body.

can you point me to how to do that? if it is the lowest possible level way to do it, i am all the happier.

fuck json.

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

i really like the idea of running a mice site on the darkweb.

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

technically, even a forum should be dynamic.. it should update its page without refreshing.

[–]jingles[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

one advantage to creating a custom web server is that my logs are entirely custom.

they do precisely what i want them to do.

you cant do that with an off the shelf web server.