this is delightful
Show HN: Redbean – Single-file distributable web server
61–70 of 264 posts
Re: Show HN: Redbean – Single-file distributable web server
#62Am I the only one having issues trying to get this working? The webserver starts just fine, but once I add the index.html with zip as in the example, it stops working. This is on Mac 10.15, CentOS 8 and Ubuntu 18.04 LTS. Centos: [centos@test ~]$ ./redbean.com -vv error: Uncaught SIGSEGV on test.novalocal ./redbean.com EINVAL/err=22/errno:2/GetLastError:0 Linux test.novalocal 4.18.0-240.10.1.el8_3.x86_64 #1 SMP Mon Ja…
$ bash -c './redbean.com -vv'
W2021-02-26T01:50:12.665277:tool/net/redbean.c:1144:redbean:3302] setsockopt(server, IPPROTO_TCP, TCP_FASTOPEN, &yes, sizeof(yes)) → EINVAL/err=22/errno:22/GetLastError:0
W--------------------000015:tool/net/redbean.c:1145:redbean:3302] setsockopt(server, IPPROTO_TCP, TCP_QUICKACK, &yes, sizeof(yes)) → ENOPROTOOPT/err=42/errno:42/GetLastError:0
V--------------------000022:tool/net/redbean.c:1166:redbean:3302] 0.0.0.0:8080 listen
Visiting http://127.0.0.1:8080/ in my web browser shows a nice redbean page with lobster graphic at http://127.0.0.1:8080/tool/net/redbean.html
but then following usage instructions in another shell: $ echo 'hello' >index.html
$ zip redbean.com index.html
adding: index.html (stored 0%)
$ ./redbean.com -vv
Killed: 9
I blame my zip $ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.
Addition of index.html shrinks(!) redbean.com from size 204800 to size 204348, with changes starting from char 172938. That clearly corrupts the portable executable format.Re: Show HN: Redbean – Single-file distributable web server
#63I just spent 30 minutes reading about this. I'm so shocked that I'm logging in to comment after 5 years of lurking. Justine has built a c library that allows you compile a binary once and have it run it on any os or baremetal. The SAME binary. Quite frankly, that sentence doesn't even make sense to me. Check out https://storage.googleapis.com/justine/cosmopolitan/index.ht... As far as I'm concerned, this is literal m…
Will this work if your code uses the C++ standard library ? Or is this just for pure C ?
Re: Show HN: Redbean – Single-file distributable web server
#64Nice job, Justine. This level of excitement reminds me of the early days of Linux. I think it has the potential to go far.
Re: Show HN: Redbean – Single-file distributable web server
#65Earlier quoted context omitted.
After adding a new file with WinRAR, I get: EINVAL/err=87/errno:2/GetLastError:203 The parameter is incorrect. Probably the ZIP needs to be saved in a certain format.
Author here. The zip shouldn't need to be saved in any special format. If WinRAR is posing problems then please file an issue because I'd like to fix that. That error doesn't seem like something that would indicate executable corruption. I want to learn more.
Re: Show HN: Redbean – Single-file distributable web server
#66Re: Show HN: Redbean – Single-file distributable web server
#67Am I the only one having issues trying to get this working? The webserver starts just fine, but once I add the index.html with zip as in the example, it stops working. This is on Mac 10.15, CentOS 8 and Ubuntu 18.04 LTS. Centos: [centos@test ~]$ ./redbean.com -vv error: Uncaught SIGSEGV on test.novalocal ./redbean.com EINVAL/err=22/errno:2/GetLastError:0 Linux test.novalocal 4.18.0-240.10.1.el8_3.x86_64 #1 SMP Mon Ja…
$ bash -c './redbean.com -vv'
W2021-02-26T02:06:29.162953:tool/net/redbean.c:1144:redbean:83621] setsockopt(server, IPPROTO_TCP, TCP_FASTOPEN, &yes, sizeof(yes)) → EINVAL/err=22/errno:22/GetLastError:0
W--------------------000026:tool/net/redbean.c:1145:redbean:83621] setsockopt(server, IPPROTO_TCP, TCP_QUICKACK, &yes, sizeof(yes)) → ENOPROTOOPT/err=42/errno:42/GetLastError:0
error:./redbean.com: check failed: 0xffffffffffffffff != 0xffffffffffffffff (48)
6fffffffff70 0000004034cf UNKNOWN
6fffffffff80 000000403225 UNKNOWN
6fffffffffc0 0000004027f3 UNKNOWN
6fffffffffe0 000000402a21 UNKNOWN
7ffeefbff870 00000040227b UNKNOWNRe: Show HN: Redbean – Single-file distributable web server
#68Can someone elaborate on the relationship between gzip and kernel space copies?
Re: Show HN: Redbean – Single-file distributable web server
#69Earlier quoted context omitted.
For real. It's hard to grok cause there are no words to describe it. When people say that something is cross-platform, they usually mean a) that the software will build on multiple platforms b) there is some sort of vm which runs the executable (jvm, beam, wasm) This is the SAME binary. Running everywhere. Could be super-useful as an archival format for mission critical code. sqlite comes to mind. Maybe it's late at…
Author here. Thanks! I've added a new sponsor tier per your request. https://github.com/sponsors/jart
Re: Show HN: Redbean – Single-file distributable web server
#70Earlier quoted context omitted.
Author here. Absolutely. I used to love Turbo Pascal and Delphi when I was younger. If Free Pascal uses GNU LD.BFD or LLVM LLD when it links programs, then all you'd need to do is is configure it to use cosmopolitan.a when linking system call functions like read(), write(), etc. See https://github.com/jart/cosmopolitan Another option is if Free Pascal wants to write all the system call support from scratch, then doin…
I love what you've produced here. I noticed that pthreads seems to be fail-stubbed for the time being, i guess it's a todo with tricky semantics? As for holding off on UI for the time being is probably the right thing to do, keeping with the minimal style planning on going for raw-x11,etc. However, as much as I personally love plain framebuffers (late 90s democoder myself), it'd be totally non-accessible for "plain"…
As for GUIs I'm still open to merging raw x11 support. One tricky issue is that we'd need to define a new API that veneers framebuffers, and so far Cosmopolitan has mostly refrained from defining novel interfaces, since the focus has been twiddling with low level magic numbers in order to make the textbook interfaces we already have work everywhere!