mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
[GH-ISSUE #103] Plugin to enable more then one address/port on connection and automatically switch them #87
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#87
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @allanpk716 on GitHub (Mar 30, 2021).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/103
Originally assigned to: @VShawn on GitHub.
Is your feature request related to a problem? Please describe.
It's not a problem. it's a new feature.
In some cases, I have a server, it can be connected in 2 ways ( 1. LAN. 2. FRP local host ), so i need create 2 connection items in PRemote and I need remember where am I then use which connection item to connect the server.
在某些应用场景下,比如我有一台服务器,然后可以有两种连接到它的方式(1,局域网直连。2,FRP 映射端口后本地连接)。现在就需要创建两个连接的选项卡。然后在公司在家或者外出,需要使用的时候,得想一下到底得用那个连接选项卡才对。
Describe the solution you'd like
So I add a feature, that you can only create one connection item , use anywhere. see Premote-Plugin-SmartProtocol
现在我简单实现了一个“智能”协议,这样只需要新建一个连接选项卡即可。详情请见 Premote-Plugin-SmartProtocol
Describe alternatives you've considered
see Premote-Plugin-SmartProtocol
Additional context
no
@majkinetor commented on GitHub (Mar 30, 2021):
Couldn't this be already done with pre-connect command ?
@allanpk716 commented on GitHub (Mar 30, 2021):
No, PRemote need communicate with it. When PRemote get the value back and need change the IP and port to the best way then to connect. Of course, this's change only IP/PORT config in memory , does not affect the actual storage.
这个插件需要与 PRemote 交互,然后获取到最佳的返回值后,需要动态修改连接的 IP 和 Port。当然这个是内存级的,不会影响实际的存储,当次有效。
@majkinetor commented on GitHub (Mar 30, 2021):
You could dynamically add entry in hosts file in pre connect script, although you would need to use the same port. Port could be fixed tho by option of pre connect script to return back some data, and then it could also return any parameter connection. For example if powershell script is called, it could return something like
@{ Address = '1.2.3.4'; Port = '8000 ' }or if cmd is called, it could return that in local env vars.
Now, not sure if that is easier or not, but is definitely more general solution as you could literary do anything you want, including setting up VPN/FRP or whatever.
So, your solution (since you didn't give screenshots) is to add multiple IP/PORT settings to connection ? How would PRM know which one to use ? Any one that works ?
@allanpk716 commented on GitHub (Mar 30, 2021):
see this page, will tell you how it worked. Premote-Plugin-SmartProtocol 😄
@majkinetor commented on GitHub (Mar 30, 2021):
OK, thx:
So addresses are in another config file. Complicated IMO :)
As this is basically pre-processing of existing connection, I think we should go with script returning this. For example in Powershell that would be something like:
PRM could even allow specifying entire script in configuration (so that no external files are needed).
This solution is way more general of course and solves need for infinity number of plugins.
@allanpk716 commented on GitHub (Mar 30, 2021):
Now it's just an extra configurator or interaction to do the setup.
And this pull request, does not affect the use of ordinary people, can wait for the subsequent interaction can be improved.
@majkinetor commented on GitHub (Mar 30, 2021):
Facts please, not wishful thinking: any script - PoweShell (with adequate params) or cmd can execute within 1s especially cmd which is probably almost instant but has very bad programming capabilities.
Also, do you really need ultimate speed here ? Its not that different If you connect in 100ms or 3 seconds in non regular weird use case, what is important is easiness of setup and options, no weird surprises in 99% of cases, and approachable mental model of application.
Really ? I provided 4 lines instead of your 100+ lines or so ? It could be one liner really.
The above command support multithreading, as posh in general, see example 1 or example 2. I just didn't use it to show the concept.
It solves the problem if script communicates back. It also solves 1M other problems.
To me this kind of feature is what categorizes as scratching ones itch. It bloats the main tool, requires maintenance and extra documentation and so on. I am not against having it, just not within main codebase , perhaps there should be external plugins repository. Then maintenance of this plugin isn't on main dev but community. Scripting extensions could be good for easy to use no-development-tools-needed cases as those come out of the box with operating system and don't require anything but notepad.
Of course, that is my personal opinion, please don't take this as something against your work which is nice idea. @VShawn might have totally other one.
@allanpk716 commented on GitHub (Mar 30, 2021):
I want know 1M other problem is?
@allanpk716 commented on GitHub (Mar 30, 2021):
You talk a lot, but you don't solve the problem of external execution and then changing the local IP and port.Don't just give that solution when you don't know what the requirements are.
@VShawn commented on GitHub (Mar 30, 2021):
This implementation seems very controversial, and the merger is put on hold.
For me, this feature is dispensable. I created two profiles for the local network and public network of a server, and I didn't feel it troublesome in switching them.
I dont like this implement with external tool, it‘s not friendly to config, and the address in external is not been encrypted, and it can not publish to Microsoft Store, but I don’t have a better idea, I once designed to allow a profile to contain multiple IP addresses and allow people to choose from the launcher menu, but this design would break the basic data structure in PRM, so I have not made my mind to change PRM like this.
@allanpk716 commented on GitHub (Mar 30, 2021):
Why don't you first think about what the solution is supposed to solve and then come up with a workable solution instead of just saying something that doesn't really matter