MCPcopy Index your code
hub / github.com/XTLS/Xray-core / NewStack

Function NewStack

proxy/tun/stack_gvisor.go:50–59  ·  view source on GitHub ↗

NewStack builds new ip stack (using gVisor)

(ctx context.Context, options StackOptions, handler *Handler)

Source from the content-addressed store, hash-verified

48
49// NewStack builds new ip stack (using gVisor)
50func NewStack(ctx context.Context, options StackOptions, handler *Handler) (Stack, error) {
51 gStack := &stackGVisor{
52 ctx: ctx,
53 tun: options.Tun.(GVisorTun),
54 idleTimeout: options.IdleTimeout,
55 handler: handler,
56 }
57
58 return gStack, nil
59}
60
61// Start is called by Handler to bring stack to life
62func (t *stackGVisor) Start() error {

Callers 1

InitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…