Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust cira tunnel_lifetime to 1 hour #1342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/amt/APFProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { EventEmitter } from 'node:events'
import { Environment } from '../utils/Environment.js'

const KEEPALIVE_INTERVAL = 30 // 30 seconds is typical keepalive interval for AMT CIRA connection
const TUNNEL_LIFETIME = 3600 // 3600 seconds (1 hour) will cause AMT to disconnect and reconnect. This is a work around where AMT can get into a disconnected state and never attempt to reconnect.

export enum APFProtocol {
UNKNOWN = 0,
Expand Down Expand Up @@ -298,7 +299,7 @@ const APFProcessor = {
APFProcessor.SendTcpForwardSuccessReply(socket, port)
// 5900 port is the last TCP port on which connections for forwarding are to be cancelled. Ports order: 16993, 16992, 664, 623, 16995, 16994, 5900
// Request keepalive interval time
if (port === 5900) { APFProcessor.SendKeepaliveOptionsRequest(socket, KEEPALIVE_INTERVAL, 0) }
if (port === 5900) { APFProcessor.SendKeepaliveOptionsRequest(socket, KEEPALIVE_INTERVAL, TUNNEL_LIFETIME) }
return 14 + requestLen + addrLen
}

Expand Down
Loading