Skip to content

Commit

Permalink
configure destination
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna committed Mar 28, 2012
1 parent 4304108 commit cad4d68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/spedye_conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ init_blank_config(spedye_conf_t *conf)
spedye_vhost_t *vhost = calloc(1, sizeof(spedye_vhost_t));
spedye_listener_t *lrec = calloc(1, sizeof(spedye_listener_t));
conf->listeners = lrec;
vhost->destport = 80;
lrec->port = 443;
lrec->vhosts = vhost;
}
Expand Down
15 changes: 14 additions & 1 deletion src/spedye_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,22 @@ process_args(spedye_conf_t *conf, int argc, char *argv[])
conf->listeners->address = strdup(arg);
}
/* TODO: proper parse IP:port, handle v6 */

continue;
}

if (long_arg("-f", "--forward", i, argc, argv, &arg)) {
i++;

p = strrchr(arg, ':');

if (p) {
conf->listeners->vhosts->destport = atoi(p+1);
*p = '\0';
}

conf->listeners->vhosts->destaddress = strdup(arg);
}

}
conf->worker_count = 10;
return 0;
Expand Down

0 comments on commit cad4d68

Please sign in to comment.