mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-05 10:48:29 +00:00
Add HTTP/HTTPS Fetch() API to redbean
You can now say the following in your redbean Lua code: status,headers,payload = Fetch("https://foo.example") The following Lua APIs have been introduced: - Fetch(str) → str,{str:str},str - GetHttpReason(int) → str - GetHttpReason(int) → str - ProgramSslFetchVerify(bool) - ProgramSslClientVerify(bool) The following flags have been introduced: - `-j` enables client SSL verification - `-k` disables Fetch() SSL verification - `-t INT` may now be passed a negative value for keepalive Lua exceptions now invoke Cosmopolitan's garbage collector when unwinding the stack. So it's now safe to use _gc() w/ Lua 𝔱𝔥𝔯𝔬𝔴 See #97
This commit is contained in:
parent
36b2710e1a
commit
c89bc56f6a
35 changed files with 1611 additions and 591 deletions
|
@ -10,6 +10,7 @@ extern const long TCP_COOKIE_TRANSACTIONS;
|
|||
extern const long TCP_CORK;
|
||||
extern const long TCP_DEFER_ACCEPT;
|
||||
extern const long TCP_FASTOPEN;
|
||||
extern const long TCP_FASTOPEN_CONNECT;
|
||||
extern const long TCP_INFO;
|
||||
extern const long TCP_KEEPCNT;
|
||||
extern const long TCP_KEEPIDLE;
|
||||
|
@ -31,40 +32,43 @@ extern const long TCP_SYNCNT;
|
|||
extern const long TCP_THIN_DUPACK;
|
||||
extern const long TCP_THIN_LINEAR_TIMEOUTS;
|
||||
extern const long TCP_TIMESTAMP;
|
||||
extern const long TCP_ULP;
|
||||
extern const long TCP_USER_TIMEOUT;
|
||||
extern const long TCP_WINDOW_CLAMP;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define TCP_CC_INFO SYMBOLIC(TCP_CC_INFO)
|
||||
#define TCP_CONGESTION SYMBOLIC(TCP_CONGESTION)
|
||||
#define TCP_COOKIE_TRANSACTIONS SYMBOLIC(TCP_COOKIE_TRANSACTIONS)
|
||||
#define TCP_CORK SYMBOLIC(TCP_CORK)
|
||||
#define TCP_DEFER_ACCEPT SYMBOLIC(TCP_DEFER_ACCEPT)
|
||||
#define TCP_FASTOPEN SYMBOLIC(TCP_FASTOPEN)
|
||||
#define TCP_INFO SYMBOLIC(TCP_INFO)
|
||||
#define TCP_KEEPCNT SYMBOLIC(TCP_KEEPCNT)
|
||||
#define TCP_KEEPIDLE SYMBOLIC(TCP_KEEPIDLE)
|
||||
#define TCP_KEEPINTVL SYMBOLIC(TCP_KEEPINTVL)
|
||||
#define TCP_LINGER2 SYMBOLIC(TCP_LINGER2)
|
||||
#define TCP_MAXSEG SYMBOLIC(TCP_MAXSEG)
|
||||
#define TCP_MD5SIG SYMBOLIC(TCP_MD5SIG)
|
||||
#define TCP_MD5SIG_MAXKEYLEN SYMBOLIC(TCP_MD5SIG_MAXKEYLEN)
|
||||
#define TCP_NODELAY LITERALLY(1)
|
||||
#define TCP_NOTSENT_LOWAT SYMBOLIC(TCP_NOTSENT_LOWAT)
|
||||
#define TCP_QUEUE_SEQ SYMBOLIC(TCP_QUEUE_SEQ)
|
||||
#define TCP_QUICKACK SYMBOLIC(TCP_QUICKACK)
|
||||
#define TCP_REPAIR SYMBOLIC(TCP_REPAIR)
|
||||
#define TCP_REPAIR_OPTIONS SYMBOLIC(TCP_REPAIR_OPTIONS)
|
||||
#define TCP_REPAIR_QUEUE SYMBOLIC(TCP_REPAIR_QUEUE)
|
||||
#define TCP_SAVED_SYN SYMBOLIC(TCP_SAVED_SYN)
|
||||
#define TCP_SAVE_SYN SYMBOLIC(TCP_SAVE_SYN)
|
||||
#define TCP_SYNCNT SYMBOLIC(TCP_SYNCNT)
|
||||
#define TCP_THIN_DUPACK SYMBOLIC(TCP_THIN_DUPACK)
|
||||
#define TCP_CC_INFO SYMBOLIC(TCP_CC_INFO)
|
||||
#define TCP_CONGESTION SYMBOLIC(TCP_CONGESTION)
|
||||
#define TCP_COOKIE_TRANSACTIONS SYMBOLIC(TCP_COOKIE_TRANSACTIONS)
|
||||
#define TCP_CORK SYMBOLIC(TCP_CORK)
|
||||
#define TCP_DEFER_ACCEPT SYMBOLIC(TCP_DEFER_ACCEPT)
|
||||
#define TCP_FASTOPEN SYMBOLIC(TCP_FASTOPEN)
|
||||
#define TCP_FASTOPEN_CONNECT SYMBOLIC(TCP_FASTOPEN_CONNECT)
|
||||
#define TCP_INFO SYMBOLIC(TCP_INFO)
|
||||
#define TCP_KEEPCNT SYMBOLIC(TCP_KEEPCNT)
|
||||
#define TCP_KEEPIDLE SYMBOLIC(TCP_KEEPIDLE)
|
||||
#define TCP_KEEPINTVL SYMBOLIC(TCP_KEEPINTVL)
|
||||
#define TCP_LINGER2 SYMBOLIC(TCP_LINGER2)
|
||||
#define TCP_MAXSEG SYMBOLIC(TCP_MAXSEG)
|
||||
#define TCP_MD5SIG SYMBOLIC(TCP_MD5SIG)
|
||||
#define TCP_MD5SIG_MAXKEYLEN SYMBOLIC(TCP_MD5SIG_MAXKEYLEN)
|
||||
#define TCP_NODELAY LITERALLY(1)
|
||||
#define TCP_NOTSENT_LOWAT SYMBOLIC(TCP_NOTSENT_LOWAT)
|
||||
#define TCP_QUEUE_SEQ SYMBOLIC(TCP_QUEUE_SEQ)
|
||||
#define TCP_QUICKACK SYMBOLIC(TCP_QUICKACK)
|
||||
#define TCP_REPAIR SYMBOLIC(TCP_REPAIR)
|
||||
#define TCP_REPAIR_OPTIONS SYMBOLIC(TCP_REPAIR_OPTIONS)
|
||||
#define TCP_REPAIR_QUEUE SYMBOLIC(TCP_REPAIR_QUEUE)
|
||||
#define TCP_SAVED_SYN SYMBOLIC(TCP_SAVED_SYN)
|
||||
#define TCP_SAVE_SYN SYMBOLIC(TCP_SAVE_SYN)
|
||||
#define TCP_SYNCNT SYMBOLIC(TCP_SYNCNT)
|
||||
#define TCP_THIN_DUPACK SYMBOLIC(TCP_THIN_DUPACK)
|
||||
#define TCP_THIN_LINEAR_TIMEOUTS SYMBOLIC(TCP_THIN_LINEAR_TIMEOUTS)
|
||||
#define TCP_TIMESTAMP SYMBOLIC(TCP_TIMESTAMP)
|
||||
#define TCP_USER_TIMEOUT SYMBOLIC(TCP_USER_TIMEOUT)
|
||||
#define TCP_WINDOW_CLAMP SYMBOLIC(TCP_WINDOW_CLAMP)
|
||||
#define TCP_TIMESTAMP SYMBOLIC(TCP_TIMESTAMP)
|
||||
#define TCP_ULP SYMBOLIC(TCP_ULP)
|
||||
#define TCP_USER_TIMEOUT SYMBOLIC(TCP_USER_TIMEOUT)
|
||||
#define TCP_WINDOW_CLAMP SYMBOLIC(TCP_WINDOW_CLAMP)
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_TCP_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue