Karl Seguin
4dbba103d4
In release mode, switch from page_allocator to c_allocator
2025-02-20 08:09:53 +08:00
Karl Seguin
94be7a0e79
Make TCP server websocket-aware
...
Adding HTTP & websocket awareness to the TCP server.
HTTP server handles `GET /json/version` and websocket upgrade requests.
Conceptually, websocket handling is the same code as before, but receiving
data will parse the websocket frames and writing data will wrap it in
a websocket frame.
The previous `Ctx` was split into a `Server` and a `Client`. This was
largely done to make it easy to write unit tests, since the `Client` is
a generic, all its dependencies (i.e. the server) can be mocked out. This
also makes it a bit nicer to know if there is or isn't a client (via the
server's client optional).
Added a MemoryPool for the Send object (I thought that was a nice touch!)
Removed MacOS hack on accept/conn completion usage.
Known issues:
- When framing an outgoing message, the entire message has to be duped. This
is no worse than how it was before, but it should be possible to eliminate
this in the future. Probably not part of this PR.
- Websocket parsing will reject continuation frames. I don't know of a single
client that will send a fragmented message (websocket has its own
message fragmentation), but we should probably still support this just in
case.
- I don't think the receive, timeout and close completions can safely be
re-used like we're doing. I believe they need to be associated with a specific
client socket.
- A new connection creates a new browser session. I think this is right (??),
but for the very first, we're throwing out a perfectly usable session. I'm
thinking this might be a change to how Browser/Sessions work.
- zig build test won't compile. This branch reproduces the issue with none
of these changes:
https://github.com/karlseguin/browser/tree/broken_test_build
(or, as a diff to main):
https://github.com/lightpanda-io/browser/compare/main...karlseguin:broken_test_build
2025-02-13 08:51:19 +08:00
Pierre Tachoire
4c9a24c64e
start inspector when the js env starts
2025-01-13 10:53:38 +01:00
Pierre Tachoire
2fed239ece
browser: split page start from page navigate
2025-01-13 10:53:29 +01:00
Pierre Tachoire
ab4973ab6c
add --verbose option
2024-12-13 12:29:05 +01:00
Francis Bouvier
766aa0f60a
Merge pull request #320 from lightpanda-io/http_json_version
...
websockets: add addr server info in Stream
2024-12-04 15:56:06 +01:00
Francis Bouvier
8ef79e348c
websockets: add addr server info in Stream
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-12-04 12:07:52 +01:00
Francis Bouvier
b800d0eeb8
msg: fix len for msg.Buffer and encode msg size as binary header
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-29 15:07:52 +01:00
Francis Bouvier
d95462073a
websockets: fix port default in help
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-29 15:06:22 +01:00
Francis Bouvier
760c082757
cli: wording mode -> opts
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-27 21:24:09 +01:00
Francis Bouvier
8449d5ab22
websocket: use Unix socket for internal server
...
And add an option for TCP only server
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-27 21:24:09 +01:00
Francis Bouvier
325ecedf0b
websocket: first implementation
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-27 21:24:09 +01:00
Francis Bouvier
5b5d28f7c1
Merge pull request #302 from lightpanda-io/zig-async-io
...
Use zig-async-io for xhr requests
2024-11-21 16:52:36 +01:00
Francis Bouvier
de286dd78e
async: use zig-async-io
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-21 16:42:48 +01:00
Francis Bouvier
ac77453139
cli: code refacto
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-10 13:53:07 +01:00
Francis Bouvier
8a25545cac
memory: use a GPA in Debug mode and a page allocator in Release
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-09 13:34:15 +01:00
Francis Bouvier
c3a3ac19f4
server: set TCP.NODELAY on linux to avoid latency issues
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-11-01 17:54:49 +01:00
Francis Bouvier
cf0636ca63
Update src/main.zig usage
...
Co-authored-by: Pierre Tachoire <pierre@lightpanda.io >
2024-10-29 22:19:44 +01:00
Francis Bouvier
486c19079a
Merge get and server binaires
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-18 16:06:23 +02:00
Francis Bouvier
8e05f09fc8
server, cdp: improve logging
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-15 22:57:56 +02:00
Francis Bouvier
ea9af210f9
Remove heap allocation for Session
...
And adapt to similar changes on zig-js-runtime for Env
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-15 15:52:48 +02:00
Francis Bouvier
efca71510a
browser: put back VM is an arg for browser init
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-12 10:41:59 +02:00
Francis Bouvier
9400dd799e
Add cli options for server (host, port, timeout)
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-09 12:06:39 +02:00
Francis Bouvier
b0ff325125
server: move to TCP conn
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-08 23:44:47 +02:00
Francis Bouvier
9c913b2e6c
Move loop outside Browser
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-07 15:57:16 +02:00
Francis Bouvier
94d2d28806
Redirect Runtime domain to JS engine Inspector
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-10-01 17:12:08 +02:00
Francis Bouvier
ea410c8ced
Fix changes in Zig 0.12 std lib
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-06-20 00:32:06 +02:00
Francis Bouvier
ed38705efd
Basic version using Browser
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-04-19 11:57:44 +02:00
Francis Bouvier
c57bb9ef72
WIP: CDP
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-04-15 12:14:33 +02:00
Francis Bouvier
b8ec53f708
Adapt to js_exec changes in zig-js-runtime
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-07-18 12:10:06 +02:00
Pierre Tachoire
f2a406d224
move netsurf and mimalloc into modules
2024-06-18 16:13:27 +02:00
Pierre Tachoire
c555c325e9
upgrade to zig 0.12
...
0.12.0-dev.3439+31a7f22b8
2024-06-18 16:13:26 +02:00
Pierre Tachoire
e18d04a799
userctx: inject user context
2024-05-22 14:45:34 +02:00
Pierre Tachoire
2a3a243d1c
add AGPL license header in zig files
2024-05-13 20:51:36 +02:00
Pierre Tachoire
3834ebcfa4
replace calloc with mimalloc
2024-04-19 11:46:42 +02:00
Pierre Tachoire
886c9daa47
window: inject DocumentHTML instead of Document
2024-03-08 12:24:24 +01:00
Pierre Tachoire
fec212ab94
window: use window as global object
2024-03-08 12:24:23 +01:00
Pierre Tachoire
b53d4a149c
add nav web api
2024-01-17 18:21:47 +01:00
Pierre Tachoire
028cd2331f
netsurf: pass encoding to the parser
2024-01-12 15:22:30 +01:00
Francis Bouvier
a5dfa6cb44
Adopt global Types changes in jsruntime
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2024-01-10 11:56:53 +01:00
Pierre Tachoire
5496e68a02
netsurf: remove documentHTMLParseFromFile
2024-01-09 11:35:18 +01:00
Pierre Tachoire
0159051b17
netsurf: remove deprecated API for parsing HTML
2024-01-08 16:02:53 +01:00
Pierre Tachoire
165f7a9ff3
use const for unmutated var
2023-12-05 14:09:25 +01:00
Francis Bouvier
2065d47d8e
Check DOMError
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2023-11-28 17:55:49 +01:00
Francis Bouvier
b4951ffa51
Adapt to js_env.start change
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2023-11-24 19:37:45 +01:00
Francis Bouvier
c751b5f420
Update jsruntime
...
Signed-off-by: Francis Bouvier <francis@lightpanda.io >
2023-11-21 12:16:51 +01:00
Francis Bouvier
3c5f1b89e7
Update jsruntime + fix breaking changes
...
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com >
2023-10-23 13:03:39 +02:00
Francis Bouvier
28b1bee241
Alias global as self and window
...
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com >
2023-10-10 14:49:57 +02:00
Pierre Tachoire
ac8317adf4
netsurf: use parse helper
2023-10-04 18:29:35 +02:00
Pierre Tachoire
818d4f4af2
netsurf: update parseDocumentHtml breaking change
2023-10-04 18:28:01 +02:00