forked from bytecodealliance/jco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sockets deny functionality (bytecodealliance#310)
- Loading branch information
1 parent
5f62577
commit c4565b7
Showing
12 changed files
with
98 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import { WasiSockets } from "./sockets/wasi-sockets.js"; | ||
|
||
export const { | ||
ipNameLookup, | ||
instanceNetwork, | ||
network, | ||
tcpCreateSocket, | ||
udpCreateSocket, | ||
tcp, | ||
udp, | ||
} = new WasiSockets(); | ||
import { WasiSockets, denyDnsLookup, denyTcp, denyUdp } from "./sockets/wasi-sockets.js"; | ||
|
||
export function _denyDnsLookup() { | ||
denyDnsLookup(sockets); | ||
} | ||
|
||
export function _denyTcp() { | ||
denyTcp(sockets); | ||
} | ||
|
||
export function _denyUdp() { | ||
denyUdp(sockets); | ||
} | ||
|
||
const sockets = new WasiSockets(); | ||
|
||
export const { | ||
ipNameLookup, | ||
instanceNetwork, | ||
network, | ||
tcpCreateSocket, | ||
udpCreateSocket, | ||
tcp, | ||
udp, | ||
} = sockets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { _denyDnsLookup } from '@bytecodealliance/preview2-shim/sockets'; | ||
|
||
_denyDnsLookup(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { _denyTcp } from '@bytecodealliance/preview2-shim/sockets'; | ||
|
||
_denyTcp(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { _denyUdp } from '@bytecodealliance/preview2-shim/sockets'; | ||
|
||
_denyUdp(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters