I am using SharePoint framework webpart and the default port for workbench is 4321, for another webpart developing the port is reserved and the workbench page is cant reach, I changed the port to 4322 for example, but how we can unreserved the default port?
The port for SPFX WebPart is denified in config->serve.json, you can change to the default port there:
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:5432/workbench",
"api": {
"port": 5432,
"entryPath": "node_modules/#microsoft/sp-webpart-workbench/lib/api/"
}
}
Related
Background
I have the following launchsettings.json:
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:54732",
"sslPort": 44382
}
},
"profiles": {
"NoteKeeperService": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7249;http://localhost:5249",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
This was generated by Visual Studio and I am trying to understand the different ports that it generated. Specifically there are 4 different ports generated by Visual Studio:
The four ports are:
iisSettings->iisExpress->applicationUrl (Line 7)
Port: 54732 - (http)
iiSettings->IssExpress->sslPort (Line 8)
Port: 44382 - (https)
profiles->applicationUrl (Line 17)
Port: 7249 - (https)
Port: 5249 - (http)
There are a pair (http and https) for IIS Express and a pair for the service directly (when it runs inside of Visual Studio, I think...?) I am guessing they all different so you don't get any port conflicts when running in IIS Express and locally.
Question
And what range rules do these ports follow for generation?
Details (ignorable)
I am creating my own template, and I want to make sure I understand the ranges for each port number so I don't put the ports in an invalid range. The dotnet templating system has a generator for ports, but it requires that I supply a range value for the ports. I am unsure what those ranges should be, or if it even matters.
This is actually more of an OS/Infrastructure question than a Visual Studio question, since ports are how the system will manage communications.
Generally speaking ports < 1024 may be "reserved" for use by "well known" programs. e.g. 80 for http, 443 for https, 21 for ftp etc.
The IANA port list may give you a more complete picture
Safe to say for your Visual Studio template any port between 1025 and 65000 should suffice. It should be up to the end user (developer in this case) to determine if the high range port is already in use by another development project.
I'm trying to mimic my working WinSCP FTP site on Visual Studio Code with the FTP-Sync package and I can't get this done for some reason.
Our server requires implicit FTP so my working site is ftps://ftpwebsite.user:990 and it prompts for my user and pass which works.
This package tries to connect for a minute and then closes with no luck.
Config file:
{
"protocol": "ftps",
"host": "ftpweb.user",
"port": 990,
"user": "ftpweb.user|user123",
"pass": "**********",
"remote": "/",
"secure": false,
"uploadOnSave": true,
"passive": true,
"debug": true,
"privateKeyPath": null,
"passphrase": null,
"agent": null,
"watch":[],
"watchTimeout": 500,
"allow": [],
"ignore": [
"\\.vscode",
"\\.git",
"\\.DS_Store"
],
"generatedFiles": {
"extensionsToInclude": [
""
],
"path": ""
}
}
It seems that the ftp-sync uses Node.js node-ftp module.
And it seems that for it to use implicit TLS/SSL, you need to set secure to implicit:
secure - mixed - Set to true for both control and data connection encryption, 'control' for control connection encryption only, or 'implicit' for implicitly encrypted control connection (this mode is deprecated in modern times, but usually uses port 990) Default: false
See also How to connect to a implicit FTPS server with nodeJS?
Though are you sure that you need to use the implicit mode? As even mentioned in the above documentation, the implicit mode is obsolete.
I have some apis, and a api-gateway in front of them. It happens to be Ocelot
this is my configuration on my local environment:
"ReRoutes": [
{
"DownstreamPathTemplate": "/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost",
"Port": 5000
}
],
"UpstreamPathTemplate": "/api1/{everything}",
"UpstreamHttpMethod": [ "Get", "Post" ]
},
the api is running as Kestrel. No docker.
On the production system however it should be installed in IIS
The problem is this:
on my locan environment all apis, nad the api gateway run on localhost, nad have a port. But on the server, they are installed as Websites, and Application inside the website. so if the website's address is xyz.com, api1's address is xyz.com/api1. and it is available. I don't want it to be available, only via the api gateway. The first quesrtion is, how to make in available only via the api gateway.
And the second issue is, it doesn't work. This is my configuration on the server:
"ReRoutes": [
{
"DownstreamPathTemplate": "/Api1Api/{everything}",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "localhost", <-- here I tried xyz.com too
"Port": 80
}
],
"UpstreamPathTemplate": "/Api1/{everything}",
"UpstreamHttpMethod": [ "Get", "Post" ]
},
If I go to xyz.com/Api1Api it is working, but I don't want it to work, but if I go to xyz.com/ApiGateway/Api1, it is not working, but I want it to work from there
I have been trying to add multiple service through configuration in consul.
But Consul UI is throwing error at startup of the agent itself.
The error is:-
$consul.exe agent --dev
Starting Consul agent...
panic: runtime error: invalid memory address or nil pointer dereference
github.com/hashicorp/consul/agent.(*Agent).loadServices(0xc0421268c0,
0xc04223aa80, 0xc042254a00, 0x0)
/gopath/src/github.com/hashicorp/consul/agent/agent.go:2097
github.com/hashicorp/consul/agent.(*Agent).Start()
/gopath/src/github.com/hashicorp/consul/agent/agent.go:326
github.com/hashicorp/consul/command.(*AgentCommand).run()
/gopath/src/github.com/hashicorp/consul/command/agent.go:704
github.com/hashicorp/consul/command.(*AgentCommand).Run()
/gopath/src/github.com/hashicorp/consul/command/agent.go:653
Config file is:-
{
"Services": [{
"id": "somename",
"name": "nameofthissevice",
"service": "myservice",
"address": "127.0.0.1",
"port": 62133,
"enableTagOverride": false,
"tags" : ["service1"]
},
{
"id": "somename1",
"name": "nameofthissevice",
"service": "myservice2",
"address": "127.0.0.1",
"port": 64921,
"enableTagOverride": false,
"tags" : ["service2"]
}]
}
I am using Win 7 platform.
Could any one suggest some ideas in it.
Thx
The configuration file is not loaded, so the problem is not in the file, in order to load the configuration file you should add another flag for loading the configuration, otherwise consul will start with default configuration.
Looks like a faulty binary or incompatible version.
Your windows7 is a 32 bit arch or 64?
And which exec version of consul have you downloaded ?
My cluster Config file as follows
`
{
"name": "SampleCluster",
"clusterConfigurationVersion": "1.0.0",
"apiVersion": "01-2017",
"nodes":
[
{
"nodeName": "vm0",
"iPAddress": "here is my VPS ip",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r0",
"upgradeDomain": "UD0"
},
{
"nodeName": "vm1",
"iPAddress": "here is my another VPS ip",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r1",
"upgradeDomain": "UD1"
},
{
"nodeName": "vm2",
"iPAddress": "here is my another VPS ip",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r2",
"upgradeDomain": "UD2"
}
],
"properties": {
"reliabilityLevel": "Bronze",
"diagnosticsStore":
{
"metadata": "Please replace the diagnostics file share with an actual file share accessible from all cluster machines.",
"dataDeletionAgeInDays": "7",
"storeType": "FileShare",
"IsEncrypted": "false",
"connectionstring": "c:\\ProgramData\\SF\\DiagnosticsStore"
},
"nodeTypes": [
{
"name": "NodeType0",
"clientConnectionEndpointPort": "19000",
"clusterConnectionEndpointPort": "19001",
"leaseDriverEndpointPort": "19002",
"serviceConnectionEndpointPort": "19003",
"httpGatewayEndpointPort": "19080",
"reverseProxyEndpointPort": "19081",
"applicationPorts": {
"startPort": "20001",
"endPort": "20031"
},
"isPrimary": true
}
],
"fabricSettings": [
{
"name": "Setup",
"parameters": [
{
"name": "FabricDataRoot",
"value": "C:\\ProgramData\\SF"
},
{
"name": "FabricLogRoot",
"value": "C:\\ProgramData\\SF\\Log"
}
]
}
]
}
}
It is almost identical to standalone service fabric download demo file for untrusted cluster except my VPS ip. I enabled remote registry service.I ran the
\TestConfiguration.ps1 -ClusterConfigFilePath \ClusterConfig.Unsecure.MultiMachine.json but i got the following error.
Unable to change open service manager handle because 5
Unable to query service configuration because System.InvalidOperationException: Unable to change open service manager ha
ndle because 5
at System.Fabric.FabricDeployer.FabricDeployerServiceController.GetServiceStartupType(String machineName, String serv
iceName)
Querying remote registry service on machine <IP Address> resulted in exception: Unable to change open service manager
handle because 5.
Unable to change open service manager handle because 5
Unable to query service configuration because System.InvalidOperationException: Unable to change open service manager ha
ndle because 5
at System.Fabric.FabricDeployer.FabricDeployerServiceController.GetServiceStartupType(String machineName, String serv
iceName)
Querying remote registry service on machine <Another IP Address> resulted in exception: Unable to change open service manager
handle because 5.
Best Practices Analyzer determined environment has an issue. Please see additional BPA log output in DeploymentTraces
LocalAdminPrivilege : True
IsJsonValid : True
IsCabValid :
RequiredPortsOpen : True
RemoteRegistryAvailable : False
FirewallAvailable :
RpcCheckPassed :
NoConflictingInstallations :
FabricInstallable :
DataDrivesAvailable :
Passed : False
Test Config failed with exception: System.InvalidOperationException: Best Practices Analyzer determined environment has
an issue. Please see additional BPA log output in DeploymentTraces folder.
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
I don't understand the problem.VPSs are not locally connected. All are public IP.I don't know, this may b an issue. how do I make virtual LAN among these VPS?Can anyone give me some direction about this error?Anyone helps me is greatly appreciated.
Edit: I used VM term insted of VPS.
Finally I make this working. Actually all the nodes are in a network, i thought it wasn't. I enable file sharing. I try to access the shared file from the node where I ran configuration test to the all other nodes. I have to give the credentials of logins. And then it works like a charm.