MCPcopy
hub / github.com/Jrohy/multi-v2ray / tfo

Function tfo

v2ray_util/config_modify/base.py:153–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151
152@restart()
153def tfo():
154 gs = GroupSelector(_('modify tcpFastOpen'))
155 group = gs.group
156
157 if group == None:
158 pass
159 else:
160 if type(group.node_list[0]) == Mtproto or type(group.node_list[0]) == SS:
161 print(_("{} MTProto/Shadowsocks don't support tcpFastOpen!!!".format(run_type.capitalize())))
162 print("")
163 return
164
165 print('{}: {}'.format(_("group tcpFastOpen"), group.tfo))
166 print("")
167 print(_("1.open TFO(force open)"))
168 print(_("2.close TFO(force close)"))
169 print(_("3.delete TFO(use system default profile)"))
170 choice = readchar(_("please select: "))
171 if not choice:
172 return
173 if not choice in ("1", "2", "3"):
174 print(_("input error, please input again"))
175 return
176
177 gw = GroupWriter(group.tag, group.index)
178 if choice == "1":
179 gw.write_tfo('on')
180 elif choice == "2":
181 gw.write_tfo('off')
182 elif choice == "3":
183 gw.write_tfo('del')
184
185 return True

Callers

nothing calls this directly

Calls 4

write_tfoMethod · 0.95
GroupSelectorClass · 0.85
readcharFunction · 0.85
GroupWriterClass · 0.85

Tested by

no test coverage detected