Skip to content

Releted To Port #155

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

Closed
HirenPatelhv opened this issue Jul 25, 2018 · 19 comments
Closed

Releted To Port #155

HirenPatelhv opened this issue Jul 25, 2018 · 19 comments
Assignees
Labels
Milestone

Comments

@HirenPatelhv
Copy link

Each time application is start using different port on every plateforn, so it's very difficult in api authentication and for CORS.

@GregorBiswanger
Copy link
Member

Do you want access from a external desktop application?

For internal access, you need the BridgeSettings.WebPort-Property:
string path = $"http://localhost:{BridgeSettings.WebPort}/Home/FooBar"

@HirenPatelhv
Copy link
Author

HirenPatelhv commented Jul 26, 2018

I Want to change AspCoreBackend port and fixed it to some static port.So Everytime it run from fix port ie,Prot : 8081

@GregorBiswanger
Copy link
Member

The default Port is 8000... is this not available, we search automatically the next open port to upper...

Do you need a other solution? I can add this as a feature request... otherwise all pull request are very welcome :)

@HirenPatelhv
Copy link
Author

Yes , I want other solution ,Can you provide a way to fixed it to some static port for all platform (eg. Windows, Mac-OS, Linux) and that port is given by me.

I've developed an app using .NET Core and Electron.NET, also developed one API in .NET Core.
When I call API from it , Its give an error about "Cross-Origin", so i need to register an IP Address and Port in that API, for that i want static port.

@HirenPatelhv
Copy link
Author

HirenPatelhv commented Jul 28, 2018

How much time you will take for this solution if you do this ?

@HirenPatelhv
Copy link
Author

Hi @GregorBiswanger , Your Answer is very important for me.please help me to solve this issue.

@GregorBiswanger
Copy link
Member

I think in three weeks.. sorry...

@HirenPatelhv
Copy link
Author

thanks @GregorBiswanger , I'll wait for this feature...

@HirenPatelhv
Copy link
Author

Hi @GregorBiswanger , What is the status of this Feature.

@HirenPatelhv
Copy link
Author

Hi @GregorBiswanger ...

@HirenPatelhv
Copy link
Author

Hi @GregorBiswanger , I'm still waiting for this feature.

@HirenPatelhv
Copy link
Author

Hi @GregorBiswanger Have you add this feature...

@JimmyTheJ
Copy link

Hi @HirenPatelhv I have pushed a fix for this in my fork of this repo. I don't know if it will ever get picked up by the main repository though. If you want help getting it working I can do that.

@robertmuehsig
Copy link
Collaborator

robertmuehsig commented Dec 28, 2018

@JimmyTheJ We are pretty "bad" regarding accepting PRs or answer to questions, BUT if you would like to send a PR I try to convince my buddy @GregorBiswanger to check it.

Thanks for your help!

@JimmyTheJ
Copy link

Thanks @robertmuehsig. I put in a pull request with my changes. They also include a fix for the issue where if your assembly name is different from your executable name it won't work. I don't think the code for that fix is the most robust I've ever written though, you or @GregorBiswanger might be able to tweak it to work better.

The static port option doesn't have javascript error checking at the moment either so if the port is in use it will yell at you with some javascript errors, but until there is a really foolproof way to deal with that issue I figured I'd leave it as it indicates (at least to the developer) that you have either multiple instances of the software running still or something else is using your port.

@GregorBiswanger
Copy link
Member

Is the feature still needed?

@HirenPatelhv
Copy link
Author

Yes @GregorBiswanger , still I waiting for this feature

@GregorBiswanger GregorBiswanger added this to the 5.22.13 milestone May 29, 2019
@GregorBiswanger GregorBiswanger modified the milestones: 5.22.13, 5.22.14 Jul 26, 2019
@GregorBiswanger
Copy link
Member

Hi @HirenPatelhv,

finally I have managed to implement your feature request. You now need an additional configuration in the electron.manifest.json file with the key aspCoreBackendPort:

{
  "executable": "ElectronNET.WebApp",
  "splashscreen": {
    "imageFile": "/wwwroot/assets/img/[email protected]"
  },
  "singleInstance": false,
  "aspCoreBackendPort": 8080, <--- Your custom Port for ASP.NET Backend
  "build": {
    "appId": "com.electronnetapidemos.app",
...

The application then runs automatically as a single instance. I hope you like it that way.

The feature is available with the next update 5.22.14, which will be published as soon as possible.

@enzosagretti
Copy link

enzosagretti commented Mar 15, 2021

Hi! Thanks for all Gregor! It´s is possible to disable ASP port. I don´t want that user can acces from browser outside electron... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants