Skip to content

Commit aa1d95a

Browse files
chore: fix comment
1 parent dba0dc5 commit aa1d95a

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/mcpm/commands/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def add(profile, force=False):
160160
profile_config_manager.new_profile(profile)
161161

162162
console.print(f"\n[green]Profile '{profile}' added successfully.[/]\n")
163-
console.print(f"You can now add servers to this profile with 'mcpm add --target #{profile} <server_name>'\n")
163+
console.print(f"You can now add servers to this profile with 'mcpm add --target %{profile} <server_name>'\n")
164164
console.print(
165165
f"Or apply existing config to this profile with 'mcpm profile apply {profile} --server <server_name>'\n"
166166
)

src/mcpm/commands/router.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def router_status():
289289
@click.help_option("-h", "--help")
290290
@click.option("-a", "--address", type=str, required=False, help="Remote address to bind the tunnel to")
291291
@click.option("-p", "--profile", type=str, required=False, help="Profile to share")
292-
@click.option("-http", type=bool, flag_value=True, required=False, help="Use HTTP instead of HTTPS")
292+
@click.option("--http", type=bool, flag_value=True, required=False, help="Use HTTP instead of HTTPS")
293293
def share(address, profile, http):
294294
"""Create a share link for the MCPRouter daemon process.
295295
@@ -332,15 +332,12 @@ def share(address, profile, http):
332332
remote_host, remote_port = address.split(":")
333333

334334
# start tunnel
335-
# TODO: tls certificate if necessary
336335
tunnel = Tunnel(remote_host, remote_port, config["host"], config["port"], secrets.token_urlsafe(32), http, None)
337336
share_url = tunnel.start_tunnel()
338337
share_pid = tunnel.proc.pid if tunnel.proc else None
339338
# generate random api key
340339
api_key = str(uuid.uuid4())
341340
console.print(f"[bold green]Generated secret for share link: {api_key}[/]")
342-
if http:
343-
share_url = share_url.replace("https://", "http://")
344341
share_url = share_url + "/sse"
345342
# save share pid and link to config
346343
config_manager.save_share_config(share_url, share_pid, api_key)

src/mcpm/router/share.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,6 @@ def _raise_tunnel_error():
186186
elif "login to server failed" in line:
187187
_raise_tunnel_error()
188188

189+
if self.http:
190+
url = url.replace("https://", "http://")
189191
return url

0 commit comments

Comments
 (0)